home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998…eptember: Technology Seed / September 98 ADC Seed CD.toast / FireWire 1.1 DR2 SDK / Interfaces / FireWire.h < prev    next >
Encoding:
Text File  |  1998-01-15  |  94.2 KB  |  3,040 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FireWire.h
  3.  
  4.     Contains:    Definitions and interfaces for FireWire driver family.
  5.  
  6.     Version:    1.0
  7.  
  8.     Written by:    Erik Staats
  9.  
  10.     Copyright:    © 1996-1997 by Apple Computer, Inc., all rights reserved.
  11.  
  12.     File Ownership:
  13.  
  14.         DRI:                Jay Lloyd
  15.  
  16.         Other Contact:        xxx put other contact here xxx
  17.  
  18.         Technology:            FireWire
  19.  
  20.     Writers:
  21.  
  22.         (jkl)    Jay Lloyd
  23.  
  24.     Change History (most recent first):
  25.  
  26.        <103>    11/14/97    jkl        Add defines for FireWire Gestalt.
  27.      <FW102>     3/14/97    ES        Changed error code values to one's we've been allocated.
  28.      <FW101>      3/3/97    ES        Added DCLTimeStamp.
  29.      <FW100>     2/20/97    ES        Rearranged FWClientAsynchRequestParams, removed buffer, and
  30.                                     added receiveBuffer, transmitBuffer, and responseCode.
  31.       <FW99>     2/14/97    ES        Added FWIMFinalize and FWIMPollInterrupts to FWIM plug in
  32.                                     dispatch table.
  33.       <FW98>     2/14/97    ES        Moved transfer buffer packet size into the transfer buffer DCL
  34.                                     and removed the set packet size DCL.
  35.       <FW97>     2/14/97    ES        Added procedure prototype for FWModifyDCLList and added some
  36.                                     defs for DCL opcode flags.
  37.       <FW96>      2/6/97    ES        Removed some private fields from FWClientInterfaceParams.
  38.       <FW95>      2/6/97    ES        Removed some private fields from FWIMCommandParams record. Added
  39.                                     procedure prototypes for registering protocol drivers.
  40.       <FW94>      2/4/97    ES        Added private and initial unit address space allocation options
  41.                                     to FWAllocateAddressSpace. Added defs for initial memory,
  42.                                     private, and initial unit address spaces. Added support for
  43.                                     offset entries to FWCSRROMCreateEntry.
  44.       <FW93>     1/27/97    ES        Changed protocol driver file type to 'ndrv'. Fixes bug #1621930.
  45.       <FW92>     1/16/97    ES        Changed CSR ROM search key bit constant names. Added procedure
  46.                                     prototype for FWCSRROMDisposeEntry.
  47.       <FW91>      1/9/97    ES        Added includes so this file can compile by itself.
  48.       <FW90>      1/8/97    ES        Changed defs for kInvalidCSRROMEntryType and
  49.                                     kImmediateCSRROMEntryType. Added generation and sourceID fields
  50.                                     to FWClientAsynchRequestParams. Added procedure prototypes for
  51.                                     FWGetFWDeviceIDFromFWReferenceID, FWFindFWDeviceFromNodeID, and
  52.                                     FWGetUnitCSRROMEntryID.
  53.       <FW89>      1/1/97    ES        Added FWUpdateDCLList. Changed the DCL notification interface.
  54.                                     Changed DCL event defs to kFWDCL<Event>Event.
  55.       <FW88>    12/27/96    ES        Added a bunch of procedure prototypes.
  56.       <FW87>    12/27/96    ES        Changed a bunch of "FWDriver"s to "FWClient"s and added support
  57.                                     for protocol drivers, clients, and units.
  58.       <FW86>    12/26/96    ES        Added support for DCL program stop and release procs.
  59.       <FW85>    12/16/96    ES        Changed to work with new read/write/lock request/complete
  60.                                     processing mechanism.
  61.       <FW84>    12/26/96    ES        Consolidated some parameters in asynch FWIM commands and
  62.                                     processing.
  63.       <FW83>    12/22/96    ES        Changed IsochPortAction to IsochPortControl.
  64.       <FW82>    12/12/96    ES        Took transmit buffer out of FWIMProcessAsynchParams record.
  65.       <FW81>    12/11/96    ES        Removed some fields from FWIMProcessAsynchParams. Changed
  66.                                     FWIMProcess routines to return OSStatus.
  67.       <FW80>    12/10/96    ES        Added defs for isochronous channel force stop notification.
  68.       <FW79>     12/6/96    ES        Changed FWIMInstallParams to FWIMInitializeParams and changed
  69.                                     some of the fields in FWIMInitializeParams.
  70.                                     FWIMAsynchCommandParams were changed to supply the split
  71.                                     transaction timeout.
  72.       <FW78>     12/6/96    ES        Added FWClippedSubtract.
  73.       <FW77>     12/3/96    ES        Added kFWFixedAddress flag to FWAllocateAddressSpace.
  74.       <FW76>    11/27/96    ES        Added retryExceededErr.
  75.       <FW75>    11/26/96    ES        Added procedure prototype for FWStartDCLProgram.
  76.       <FW74>    11/11/96    ES        Added GetUniqueID FWIM command and FWDeallocateAddressSpace.
  77.       <FW73>     11/5/96    ES        Added stuff for FireWire deferred tasks.
  78.       <FW72>    10/18/96    ES        Added kDCLSendBufferOp and kDCLSetPacketSizeOp. Changed the
  79.                                     definition of DCL compiler notification procs. Added a number of
  80.                                     DCL procedure prototypes.
  81.       <FW71>    10/16/96    ES        Added stuff for bus management notification. Also, added
  82.                                     disconnectedErr.
  83.       <FW70>     10/4/96    ES        Added procedure prototype for FWCallDCLCallProc.
  84.       <FW69>     10/4/96    ES        Replaced DCLSetPacketAttributes command with DCLSetTagSyncBits
  85.                                     command. Added DCLSetPacketWithHeaderStart command.
  86.       <FW68>     10/3/96    ES        Added FWIMPluginDispatchTable stuff.
  87.       <FW67>     10/3/96    ES        Removed GetTopologyMap FWIM command. Made FWGetTopologyMap
  88.                                     immediate. Added FWProcessSelfIDs.
  89.       <FW66>     9/27/96    ES        Added procedure prototypes for routines to set and get driver
  90.                                     interface procs and removed driver interface table from
  91.                                     FWRegisterDriver.
  92.       <FW65>     9/26/96    ES        Added kFWAsynchFailOnBusReset.
  93.       <FW64>     9/26/96    ES        Added separateBusErr.
  94.       <FW63>     9/25/96    ES        Added kFWAsynchAbsoluteAddress.
  95.       <FW62>     9/25/96    ES        Added FWIM asynchronous transaction response commands. Changed
  96.                                     FWIMProcessAsynchParams record.
  97.       <FW61>     9/20/96    ES        Added kFWAsynchDisableAddressIncrement to allow disabling of
  98.                                     automatic address incrementing on asynchronous transfers.
  99.       <FW60>     9/16/96    ES        Changed FWIM and FireWire driver interfaces to return command
  100.                                     acceptance.
  101.       <FW59>     9/16/96    ES        Added response code field to FWIMProcessAsynchRequestParams.
  102.                                     Took out some unused constants and data structures.
  103.       <FW58>     9/16/96    ES        Fixed defs for kFWIsochTCode and kFWIsochTag.
  104.       <FW57>     9/11/96    ES        Changed maxRetries for FCP commands to be UInt32 instead of
  105.                                     SInt32.
  106.       <FW56>     9/11/96    ES        Added kFWMaxNodeHops, kFWTopologyMapMaxSelfIDs, and FWSpeedMap
  107.                                     defs. Added speed parameter to FWIMAsynchCommandParams.
  108.       <FW55>      9/5/96    ES        Added fwDriverAsynchRequestParams to FWIMProcessAsynchParams
  109.                                     record and changed completionProcData in FWIMProcessParams
  110.                                     record to a UInt32.
  111.       <FW54>      9/4/96    ES        Added procedure prototype for FWDeallocateIsochronousChannelID.
  112.       <FW53>      9/3/96    ES        Added driver reset notification.
  113.       <FW52>      9/3/96    ES        Added kFWIMSendLinkOnPacket.
  114.       <FW51>     8/30/96    ES        Added a bunch of stuff for isochronous resource management.
  115.       <FW50>     8/29/96    ES        Added set and clear contender bit FWIM commands.
  116.       <FW49>     8/29/96    ES        Changed FWRegisterDriver to take driver interface proc table.
  117.       <FW48>     8/28/96    ES        Added procedure prototypes for FWProcessLockRequest. Added def
  118.                                     for kFWDriverLock. Added extendedTCode to some asynch command
  119.                                     parameter records.
  120.       <FW47>     8/28/96    ES        Added kFWAsynchOverrideMaxPayload to asynch transfer flags.
  121.       <FW46>     8/26/96    ES        Put back kInvalidFWGenerationNumber.
  122.       <FW45>     8/26/96    ES        Changed to new command object interface.
  123.       <FW44>     8/26/96    ES        Added local node ID to FWIMGetTopologyMapParams record, added
  124.                                     FWGetLocalFWReferenceIDFromFWReferenceID, and changed some
  125.                                     constant names.
  126.       <FW43>     8/16/96    ES        Added immediate modes. Changed FWAllocateIsochPort to take
  127.                                     FWAllocateIsochPortParams.
  128.       <FW42>     8/15/96    ES        Added defs for queueing for FW driver commands. Added procedure
  129.                                     prototypes for dynamically changing destination of DCL jump
  130.                                     commands. Added defs for making isoch channel and port routines
  131.                                     asynchronous.
  132.       <FW41>      8/8/96    ES        Added FWTranslateDCLProgram.
  133.       <FW40>      8/2/96    ES        Replaced IsochBufferChains with DCLPrograms.
  134.       <FW39>     7/31/96    ES        Changed to implement new isochronous buffering architecture.
  135.       <FW38>      7/8/96    ES        Added support for isochronous transmission. Added FWClippedAdd.
  136.                                     Added IRM allocation option to FWAllocateIsochronousChannelID.
  137.       <FW37>     6/24/96    ES        Added FWCompareAndSwap.
  138.       <FW36>     6/20/96    ES        Made this look more like a .i generated interface.
  139.       <FW35>     6/14/96    ES        Added FWUnregisterDriver.
  140.       <FW34>     5/31/96    ES        Took out expert notification stuff and added some virtual device
  141.                                     defs.
  142.       <FW33>     4/29/96    ES        Cleaned up FWCSRROMCreateEntryID procedure prototype.
  143.       <FW32>     4/17/96    ES        Changed and added some procedure prototypes.
  144.       <FW31>     4/15/96    ES        Got rid of stuff for FWDriverInstall and added stuff for
  145.                                     FWRegisterDriver.
  146.       <FW30>      4/5/96    ES        Added a bunch of CSRROM service procedure prototypes.
  147.       <FW29>     3/29/96    ES        Moved some of the virtual device stuff here from the private
  148.                                     header.
  149.       <FW28>     3/25/96    ES        Added support for asynch request packet handling by drivers.
  150.       <FW27>     3/12/96    ES        Added FWVDeviceID.
  151.       <FW26>      3/8/96    ES        Add stuff for creating CSR configuration ROM entries on the
  152.                                     local host.
  153.       <FW25>      3/7/96    ES        Changed stuff with address spaces and FWIM processing requests.
  154.       <FW24>     2/22/96    ES        Added stuff for FWIsochResourceManagerID.
  155.       <FW23>     2/21/96    ES        Added fwimData to IsochChannelBufferStruct, changed fwimData to
  156.                                     a UInt32 in IsochBufferChainStruct, and added isochChannelID to
  157.                                     FWDriverIsochPortParamsStruct.
  158.       <FW22>     2/21/96    ES        Added a bunch of atomic operations.
  159.       <FW21>     2/16/96    ES        Added procedure prototypes for FWAllocateIsochBufferChainID and
  160.                                     FWDeallocateIsochBufferChainID and changed some stuff for
  161.                                     isochronous ports.
  162.       <FW20>      2/9/96    ES        Added stuff for FWGetTopologyMap and for synchronizing the
  163.                                     services queue.
  164.       <FW19>      2/7/96    ES        Added kInvalidNodeID.
  165.       <FW18>      2/7/96    ES        Added FWThresholdAdd and FWThresholdSubtract and a whole bunch
  166.                                     of other stuff for doing lock transactions.
  167.       <FW17>      2/2/96    ES        Added stuff for disabling the FWIM command queue and specifying
  168.                                     the bus generation number in FireWire asynch commands.
  169.       <FW16>      2/1/96    ES        Added kFWIMCommandPriorityFlag, kFWInterfacePriorityFlag, and
  170.                                     busReconfiguredErr.
  171.       <FW15>     1/30/96    ES        Added stuff for doing bus resets.
  172.       <FW14>     1/30/96    ES        Defined kFWRequestWaiting and changed pNextFWInterfaceParams in
  173.                                     FWInterfaceParamsStruct from FWInterfaceParamsPtr * to
  174.                                     FWInterfaceParamsPtr.
  175.       <FW13>     1/26/96    ES        Added FWSetMaxPayloadSize and other maxPayload stuff.
  176.       <FW12>     1/24/96    ES        Added responseHandler and settable timeout to FCP command
  177.                                     params.
  178.       <FW11>     1/18/96    ES        Added function prototypes for task and software interrupt
  179.                                     services. Changed kMaxSelfIDPacketsPerNode to 9.
  180.       <FW10>     1/12/96    ES        Added FWReleaseIsochronousChannel and
  181.                                     FWReleaseLocalIsochronousPort. Changed kFWInvalidFWIMCommandID
  182.                                     to kInvalidFWIMCommandID.
  183.        <FW9>     1/12/96    ES        Added flags to FWIMCommandParams.
  184.        <FW8>     1/11/96    ES        Changed request and interface to command in most of the FWIM
  185.                                     stuff.
  186.        <FW7>     1/11/96    ES        Changed calling parameters for FWCommandIsComplete and changed
  187.                                     to FWIMCommandIsComplete. Added stuff for FWIMCommandIDs.
  188.        <FW6>     1/10/96    ES        Added prototype for FWProcessBusReset.
  189.        <FW5>      1/9/96    ES        Added FWProcessWriteRequest and removed kFWWriteNotify.
  190.        <FW4>      1/9/96    ES        Really got rid of kFWFWIMRequestCompleteNotify.
  191.        <FW3>      1/9/96    ES        Added FWCommandIsComplete. Removed kFWFWIMRequestCompleteNotify.
  192.        <FW2>      1/6/96    ES        Fill in contains and written by fields.
  193.        <FW1>      1/6/96    ES        first checked in
  194.  
  195. */
  196.  
  197. #ifndef __FIREWIRE__
  198. #define __FIREWIRE__
  199.  
  200. #ifndef __TYPES__
  201. #include <Types.h>
  202. #endif
  203.  
  204. #ifndef __DRIVERSERVICES__
  205. #include <DriverServices.h>
  206. #endif
  207.  
  208. #ifdef __cplusplus
  209. extern "C" {
  210. #endif
  211.  
  212. #if PRAGMA_IMPORT_SUPPORTED
  213. #pragma import on
  214. #endif
  215.  
  216. #if PRAGMA_ALIGN_SUPPORTED
  217. #pragma options align=mac68k
  218. #endif
  219.  
  220.  
  221. // Generic bit defs.
  222.  
  223. enum
  224. {
  225.     kBit0                        = (1 << 0),
  226.     kBit1                        = (1 << 1),
  227.     kBit2                        = (1 << 2),
  228.     kBit3                        = (1 << 3),
  229.     kBit4                        = (1 << 4),
  230.     kBit5                        = (1 << 5),
  231.     kBit6                        = (1 << 6),
  232.     kBit7                        = (1 << 7),
  233.     kBit8                        = (1 << 8),
  234.     kBit9                        = (1 << 9),
  235.     kBit10                        = (1 << 10),
  236.     kBit11                        = (1 << 11),
  237.     kBit12                        = (1 << 12),
  238.     kBit13                        = (1 << 13),
  239.     kBit14                        = (1 << 14),
  240.     kBit15                        = (1 << 15),
  241.     kBit16                        = (1 << 16),
  242.     kBit17                        = (1 << 17),
  243.     kBit18                        = (1 << 18),
  244.     kBit19                        = (1 << 19),
  245.     kBit20                        = (1 << 20),
  246.     kBit21                        = (1 << 21),
  247.     kBit22                        = (1 << 22),
  248.     kBit23                        = (1 << 23),
  249.     kBit24                        = (1 << 24),
  250.     kBit25                        = (1 << 25),
  251.     kBit26                        = (1 << 26),
  252.     kBit27                        = (1 << 27),
  253.     kBit28                        = (1 << 28),
  254.     kBit29                        = (1 << 29),
  255.     kBit30                        = (1 << 30),
  256.     kBit31                        = (1 << 31)
  257. };
  258.  
  259. #define BitRange(start, end)                        \
  260. (                                                    \
  261.     ((((UInt32) 0xFFFFFFFF) << (31 - (end))) >>        \
  262.      ((31 - (end)) + (start))) <<                    \
  263.     (start)                                            \
  264. )
  265.  
  266. #define BitRangePhase(start, end)                    \
  267.     (start)
  268.  
  269.  
  270. ////////////////////////////////////////////////////////////////////////////////
  271. //
  272. // Standard FireWire defs.
  273. //
  274.  
  275. // FireWire bit defs.
  276.  
  277. enum
  278. {
  279.     kFWBit0                        = (1 << 31),
  280.     kFWBit1                        = (1 << 30),
  281.     kFWBit2                        = (1 << 29),
  282.     kFWBit3                        = (1 << 28),
  283.     kFWBit4                        = (1 << 27),
  284.     kFWBit5                        = (1 << 26),
  285.     kFWBit6                        = (1 << 25),
  286.     kFWBit7                        = (1 << 24),
  287.     kFWBit8                        = (1 << 23),
  288.     kFWBit9                        = (1 << 22),
  289.     kFWBit10                    = (1 << 21),
  290.     kFWBit11                    = (1 << 20),
  291.     kFWBit12                    = (1 << 19),
  292.     kFWBit13                    = (1 << 18),
  293.     kFWBit14                    = (1 << 17),
  294.     kFWBit15                    = (1 << 16),
  295.     kFWBit16                    = (1 << 15),
  296.     kFWBit17                    = (1 << 14),
  297.     kFWBit18                    = (1 << 13),
  298.     kFWBit19                    = (1 << 12),
  299.     kFWBit20                    = (1 << 11),
  300.     kFWBit21                    = (1 << 10),
  301.     kFWBit22                    = (1 << 9),
  302.     kFWBit23                    = (1 << 8),
  303.     kFWBit24                    = (1 << 7),
  304.     kFWBit25                    = (1 << 6),
  305.     kFWBit26                    = (1 << 5),
  306.     kFWBit27                    = (1 << 4),
  307.     kFWBit28                    = (1 << 3),
  308.     kFWBit29                    = (1 << 2),
  309.     kFWBit30                    = (1 << 1),
  310.     kFWBit31                    = (1 << 0)
  311. };
  312.  
  313. #define FWBitRange(start, end)                        \
  314. (                                                    \
  315.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  316.      ((start) + (31 - (end)))) <<                    \
  317.     (31 - (end))                                    \
  318. )
  319.  
  320. #define FWBitRangePhase(start, end)                    \
  321.     (31 - end)
  322.  
  323.  
  324. /*zzz Put in IEEE1212.h */
  325. ////////////////////////////////////////////////////////////////////////////////
  326. //
  327. // Define some CSR stuff.
  328. //
  329.  
  330. // CSR bit defs.
  331.  
  332. enum
  333. {
  334.     kCSRBit0                    = (1 << 31),
  335.     kCSRBit1                    = (1 << 30),
  336.     kCSRBit2                    = (1 << 29),
  337.     kCSRBit3                    = (1 << 28),
  338.     kCSRBit4                    = (1 << 27),
  339.     kCSRBit5                    = (1 << 26),
  340.     kCSRBit6                    = (1 << 25),
  341.     kCSRBit7                    = (1 << 24),
  342.     kCSRBit8                    = (1 << 23),
  343.     kCSRBit9                    = (1 << 22),
  344.     kCSRBit10                    = (1 << 21),
  345.     kCSRBit11                    = (1 << 20),
  346.     kCSRBit12                    = (1 << 19),
  347.     kCSRBit13                    = (1 << 18),
  348.     kCSRBit14                    = (1 << 17),
  349.     kCSRBit15                    = (1 << 16),
  350.     kCSRBit16                    = (1 << 15),
  351.     kCSRBit17                    = (1 << 14),
  352.     kCSRBit18                    = (1 << 13),
  353.     kCSRBit19                    = (1 << 12),
  354.     kCSRBit20                    = (1 << 11),
  355.     kCSRBit21                    = (1 << 10),
  356.     kCSRBit22                    = (1 << 9),
  357.     kCSRBit23                    = (1 << 8),
  358.     kCSRBit24                    = (1 << 7),
  359.     kCSRBit25                    = (1 << 6),
  360.     kCSRBit26                    = (1 << 5),
  361.     kCSRBit27                    = (1 << 4),
  362.     kCSRBit28                    = (1 << 3),
  363.     kCSRBit29                    = (1 << 2),
  364.     kCSRBit30                    = (1 << 1),
  365.     kCSRBit31                    = (1 << 0)
  366. };
  367.  
  368. #define CSRBitRange(start, end)                        \
  369. (                                                    \
  370.     ((((UInt32) 0xFFFFFFFF) << (start)) >>            \
  371.      ((start) + (31 - (end)))) <<                    \
  372.     (31 - (end))                                    \
  373. )
  374.  
  375. #define CSRBitRangePhase(start, end)                \
  376.     (31 - end)
  377.  
  378. // Core CSR registers.
  379.  
  380. enum
  381. {
  382.     kCSRStateUnitDepend            = CSRBitRange (0, 15),
  383.     kCSRStateUnitDependPhase    = CSRBitRangePhase (0, 15),
  384.  
  385.     kCSRStateBusDepend            = CSRBitRange (16, 23),
  386.     kCSRStateBusDependPhase        = CSRBitRangePhase (16, 23),
  387.  
  388.     kCSRStateLost                = kCSRBit24,
  389.     kCSRStateDReq                = kCSRBit25,
  390.     kCSRStateELog                = kCSRBit27,
  391.     kCSRStateAtn                = kCSRBit28,
  392.     kCSRStateOff                = kCSRBit29,
  393.  
  394.     kCSRStateState                = CSRBitRange (30, 31),
  395.     kCSRStateStatePhase            = CSRBitRangePhase (30, 31),
  396.     kCSRStateStateRunning        = 0,
  397.     kCSRStateStateInitializing    = 1,
  398.     kCSRStateStateTesting        = 2,
  399.     kCSRStateStateDead            = 3
  400. };
  401.  
  402. // Key values.
  403.  
  404. enum
  405. {
  406.     kCSRTextualDescriptorKey    = 0x01,
  407.     kCSRBusDependentInfoKey        = 0x02,
  408.     kCSRModuleVendorIDKey        = 0x03,
  409.     kCSRModuleHwVersionKey        = 0x04,
  410.     kCSRModuleSpecIdKey            = 0x05,
  411.     kCSRModuleSwVersionKey        = 0x06,
  412.     kCSRModuleDependentInfoKey    = 0x07,
  413.     kCSRNodeVendorIdKey            = 0x08,
  414.     kCSRNodeHwVersionKey        = 0x09,
  415.     kCSRNodeSpecIdKey            = 0x0A,
  416.     kCSRNodeSwVersionKey        = 0x0B,
  417.     kCSRNodeCapabilitiesKey        = 0x0C,
  418.     kCSRNodeUniqueIdKey            = 0x0D,
  419.     kCSRNodeUnitsExtentKey        = 0x0E,
  420.     kCSRNodeMemoryExtentKey        = 0x0F,
  421.     kCSRNodeDependentInfoKey    = 0x10,
  422.     kCSRUnitDirectoryKey        = 0x11,
  423.     kCSRUnitSpecIdKey            = 0x12,
  424.     kCSRUnitSwVersionKey        = 0x13,
  425.     kCSRUnitDependentInfoKey    = 0x14,
  426.     kCSRUnitLocationKey            = 0x15,
  427.     kCSRUnitPollMaskKey            = 0x16
  428. };
  429.  
  430.  
  431. // Key value bits for searching.
  432.  
  433. enum
  434. {
  435.     kCSREveryKey                = 0xFFFFFFFF,
  436.  
  437.     kCSRTextualDescriptorKeyLoBit    = (1 << kCSRTextualDescriptorKey),
  438.     kCSRTextualDescriptorKeyHiBit    = 0,
  439.     kCSRBusDependentInfoKeyLoBit    = (1 << kCSRBusDependentInfoKey),
  440.     kCSRBusDependentInfoKeyHiBit    = 0,
  441.     kCSRModuleVendorIDKeyLoBit        = (1 << kCSRModuleVendorIDKey),
  442.     kCSRModuleVendorIDKeyHiBit        = 0,
  443.     kCSRModuleHwVersionKeyLoBit        = (1 << kCSRModuleHwVersionKey),
  444.     kCSRModuleHwVersionKeyHiBit        = 0,
  445.     kCSRModuleSpecIdKeyLoBit        = (1 << kCSRModuleSpecIdKey),
  446.     kCSRModuleSpecIdKeyHiBit        = 0,
  447.     kCSRModuleSwVersionKeyLoBit        = (1 << kCSRModuleSwVersionKey),
  448.     kCSRModuleSwVersionKeyHiBit        = 0,
  449.     kCSRModuleDependentInfoKeyLoBit    = (1 << kCSRModuleDependentInfoKey),
  450.     kCSRModuleDependentInfoKeyHiBit    = 0,
  451.     kCSRNodeVendorIdKeyLoBit        = (1 << kCSRNodeVendorIdKey),
  452.     kCSRNodeVendorIdKeyHiBit        = 0,
  453.     kCSRNodeHwVersionKeyLoBit        = (1 << kCSRNodeHwVersionKey),
  454.     kCSRNodeHwVersionKeyHiBit        = 0,
  455.     kCSRNodeSpecIdKeyLoBit            = (1 << kCSRNodeSpecIdKey),
  456.     kCSRNodeSpecIdKeyHiBit            = 0,
  457.     kCSRNodeSwVersionKeyLoBit        = (1 << kCSRNodeSwVersionKey),
  458.     kCSRNodeSwVersionKeyHiBit        = 0,
  459.     kCSRNodeCapabilitiesKeyLoBit    = (1 << kCSRNodeCapabilitiesKey),
  460.     kCSRNodeCapabilitiesKeyHiBit    = 0,
  461.     kCSRNodeUniqueIdKeyLoBit        = (1 << kCSRNodeUniqueIdKey),
  462.     kCSRNodeUniqueIdKeyHiBit        = 0,
  463.     kCSRNodeUnitsExtentKeyLoBit        = (1 << kCSRNodeUnitsExtentKey),
  464.     kCSRNodeUnitsExtentKeyHiBit        = 0,
  465.     kCSRNodeMemoryExtentKeyLoBit    = (1 << kCSRNodeMemoryExtentKey),
  466.     kCSRNodeMemoryExtentKeyHiBit    = 0,
  467.     kCSRNodeDependentInfoKeyLoBit    = (1 << kCSRNodeDependentInfoKey),
  468.     kCSRNodeDependentInfoKeyHiBit    = 0,
  469.     kCSRUnitDirectoryKeyLoBit        = (1 << kCSRUnitDirectoryKey),
  470.     kCSRUnitDirectoryKeyHiBit        = 0,
  471.     kCSRUnitSpecIdKeyLoBit            = (1 << kCSRUnitSpecIdKey),
  472.     kCSRUnitSpecIdKeyHiBit            = 0,
  473.     kCSRUnitSwVersionKeyLoBit        = (1 << kCSRUnitSwVersionKey),
  474.     kCSRUnitSwVersionKeyHiBit        = 0,
  475.     kCSRUnitDependentInfoKeyLoBit    = (1 << kCSRUnitDependentInfoKey),
  476.     kCSRUnitDependentInfoKeyHiBit    = 0,
  477.     kCSRUnitLocationKeyLoBit        = (1 << kCSRUnitLocationKey),
  478.     kCSRUnitLocationKeyHiBit        = 0,
  479.     kCSRUnitPollMaskKeyLoBit        = (1 << kCSRUnitPollMaskKey),
  480.     kCSRUnitPollMaskKeyHiBit        = 0
  481. };
  482.  
  483.  
  484. // Key types.
  485.  
  486. enum
  487. {
  488.     kCSRImmediateKeyType        = 0,
  489.     kCSROffsetKeyType            = 1,
  490.     kCSRLeafKeyType                = 2,
  491.     kCSRDirectoryKeyType        = 3
  492. };
  493.  
  494.  
  495. // Key type bits for searching.
  496.  
  497. enum
  498. {
  499.     kCSREveryKeyType            = 0xFFFFFFFF,
  500.  
  501.     kCSRImmediateKeyTypeBit        = (1 << kCSRImmediateKeyType),
  502.     kCSROffsetKeyTypeBit        = (1 << kCSROffsetKeyType),
  503.     kCSRLeafKeyTypeBit            = (1 << kCSRLeafKeyType),
  504.     kCSRDirectoryKeyTypeBit        = (1 << kCSRDirectoryKeyType)
  505. };
  506.  
  507. // CSR ROM entry bit locations.
  508.  
  509. enum
  510. {
  511.     kCSRBusInfoBlockLength        = CSRBitRange (0, 7),
  512.     kCSRBusInfoBlockLengthPhase    = CSRBitRangePhase (0, 7),
  513.  
  514.     kCSRROMCRCLength            = CSRBitRange (8, 15),
  515.     kCSRROMCRCLengthPhase        = CSRBitRangePhase (8, 15),
  516.  
  517.     kCSRROMCRCValue                = CSRBitRange (16, 31),
  518.     kCSRROMCRCValuePhase        = CSRBitRangePhase (16, 31),
  519.  
  520.     kCSREntryKeyType            = CSRBitRange (0, 1),
  521.     kCSREntryKeyTypePhase        = CSRBitRangePhase (0, 1),
  522.  
  523.     kCSREntryKeyValue            = CSRBitRange (2, 7),
  524.     kCSREntryKeyValuePhase        = CSRBitRangePhase (2, 7),
  525.  
  526.     kCSREntryValue                = CSRBitRange (8, 31),
  527.     kCSREntryValuePhase            = CSRBitRangePhase (8, 31),
  528.  
  529.     kCSRLeafDirLength            = CSRBitRange (0, 15),
  530.     kCSRLeafDirLengthPhase        = CSRBitRangePhase (0, 15),
  531.  
  532.     kCSRLeafDirCRC                = CSRBitRange (16, 31),
  533.     kCSRLeafDirCRCPhase            = CSRBitRangePhase (16, 31)
  534. };
  535.  
  536. // CSR 64-bit fixed address defs.
  537.  
  538. enum
  539. {
  540.     kCSRNodeID                    = CSRBitRange (0, 15),
  541.     kCSRNodeIDPhase                = CSRBitRangePhase (0, 15),
  542.  
  543.     kCSRInitialMemorySpaceBaseAddressHi
  544.                                 = 0x00000000,
  545.     kCSRInitialMemorySpaceBaseAddressLo
  546.                                 = 0x00000000,
  547.  
  548.     kCSRPrivateSpaceBaseAddressHi
  549.                                 = 0x0000FFFF,
  550.     kCSRPrivateSpaceBaseAddressLo
  551.                                 = 0xE0000000,
  552.  
  553.     kCSRRegisterSpaceBaseAddressHi
  554.                                 = 0x0000FFFF,
  555.     kCSRRegisterSpaceBaseAddressLo
  556.                                 = 0xF0000000,
  557.  
  558.     kCSRCoreRegistersBaseAddress
  559.                                 = kCSRRegisterSpaceBaseAddressLo,
  560.     kCSRStateClearAddress        = kCSRCoreRegistersBaseAddress + 0x0000,
  561.     kCSRStateSetAddress            = kCSRCoreRegistersBaseAddress + 0x0004,
  562.     kCSRNodeIDsAddress            = kCSRCoreRegistersBaseAddress + 0x0008,
  563.     kCSRResetStartAddress        = kCSRCoreRegistersBaseAddress + 0x000C,
  564.     kCSRIndirectAddressAddress    = kCSRCoreRegistersBaseAddress + 0x0010,
  565.     kCSRIndirectDataAddress        = kCSRCoreRegistersBaseAddress + 0x0014,
  566.     kCSRSplitTimeoutHiAddress    = kCSRCoreRegistersBaseAddress + 0x0018,
  567.     kCSRSplitTimeoutLoAddress    = kCSRCoreRegistersBaseAddress + 0x001C,
  568.     kCSRArgumentHiAddress        = kCSRCoreRegistersBaseAddress + 0x0020,
  569.     kCSRArgumentLoAddress        = kCSRCoreRegistersBaseAddress + 0x0024,
  570.     kCSRTestStartAddress        = kCSRCoreRegistersBaseAddress + 0x0028,
  571.     kCSRTestStatusAddress        = kCSRCoreRegistersBaseAddress + 0x002C,
  572.     kCSRUnitsBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0030,
  573.     kCSRUnitsBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0034,
  574.     kCSRUnitsBoundHiAddress        = kCSRCoreRegistersBaseAddress + 0x0038,
  575.     kCSRUnitsBoundLoAddress        = kCSRCoreRegistersBaseAddress + 0x003C,
  576.     kCSRMemoryBaseHiAddress        = kCSRCoreRegistersBaseAddress + 0x0040,
  577.     kCSRMemoryBaseLoAddress        = kCSRCoreRegistersBaseAddress + 0x0044,
  578.     kCSRMemoryBoundHiAddress    = kCSRCoreRegistersBaseAddress + 0x0048,
  579.     kCSRMemoryBoundLoAddress    = kCSRCoreRegistersBaseAddress + 0x004C,
  580.     kCSRInterruptTargetAddress    = kCSRCoreRegistersBaseAddress + 0x0050,
  581.     kCSRInterruptMaskAddress    = kCSRCoreRegistersBaseAddress + 0x0054,
  582.     kCSRClockValueHiAddress        = kCSRCoreRegistersBaseAddress + 0x0058,
  583.     kCSRClockValueMidAddress    = kCSRCoreRegistersBaseAddress + 0x005C,
  584.     kCSRClockTickPeriodMidAddress
  585.                                 = kCSRCoreRegistersBaseAddress + 0x0060,
  586.     kCSRClockTickPeriodLoAddress
  587.                                 = kCSRCoreRegistersBaseAddress + 0x0064,
  588.     kCSRClockStrobeArrivedHiAddress
  589.                                 = kCSRCoreRegistersBaseAddress + 0x0068,
  590.     kCSRClockStrobeArrivedMidAddress
  591.                                 = kCSRCoreRegistersBaseAddress + 0x006C,
  592.     kCSRClockInfo0Address        = kCSRCoreRegistersBaseAddress + 0x0070,
  593.     kCSRClockInfo1Address        = kCSRCoreRegistersBaseAddress + 0x0074,
  594.     kCSRClockInfo2Address        = kCSRCoreRegistersBaseAddress + 0x0078,
  595.     kCSRClockInfo3Address        = kCSRCoreRegistersBaseAddress + 0x007C,
  596.     kCSRMessageRequestAddress    = kCSRCoreRegistersBaseAddress + 0x0080,
  597.     kCSRMessageResponseAddress    = kCSRCoreRegistersBaseAddress + 0x00C0,
  598.     kCSRErrorLogBufferAddress    = kCSRCoreRegistersBaseAddress + 0x0180,
  599.  
  600.     kCSRBusDependentRegistersBaseAddress
  601.                                 = kCSRRegisterSpaceBaseAddressLo + 0x0200,
  602.  
  603.     kCSRROMBaseAddress            = kCSRRegisterSpaceBaseAddressLo + 0x0400,
  604.     kCSRBIBHeaderAddress        = kCSRROMBaseAddress,
  605.     kCSRBIBBusNameAddress        = kCSRROMBaseAddress + 4
  606. };
  607.  
  608.  
  609. // CSR ROM search data types and structures.
  610.  
  611. enum {
  612. /*
  613.     ** Absolute locations
  614.     */
  615.     kIterateRoot                = 0x2L,
  616. /*
  617.     ** "Upward" Relationships    
  618.     */
  619.     kIterateParents                = 0x3L,                            /* include all  parent(s) of entry */
  620. /*
  621.     ** "Downward" Relationships
  622.     //
  623.     */
  624.     kIterateChildren            = 0x4L,                            /* include all children */
  625.     kIterateSubTrees            = 0x5L,                            /* include all sub trees of entry */
  626.     kIterateDescendants            = 0x5L,                            /* include all descendants of entry */
  627. /*
  628.     ** "Horizontal" Relationships    
  629.     */
  630.     kIterateSibling                = 0x6L,                            /* include all siblings */
  631. /*
  632.     ** Keep doing the same thing
  633.     */
  634.     kIterateContinue            = 0x1L
  635. };
  636.  
  637. enum
  638. {
  639.     kInvalidCSRROMIterator        = 0
  640. };
  641.  
  642. enum
  643. {
  644.     kCSRROMSearchForKey            = 1
  645. };
  646.  
  647. enum
  648. {
  649.     kInvalidCSRROMEntryType        = 0xFFFFFFFF,
  650.     kImmediateCSRROMEntryType    = 0,
  651.     kOffsetCSRROMEntryType        = 1,
  652.     kLeafCSRROMEntryType        = 2,
  653.     kDirectoryCSRROMEntryType    = 3
  654. };
  655.  
  656. enum
  657. {
  658.     kInvalidCSRROMEntryID        = 0                        // zzz should use generic invalid ID
  659. };
  660.  
  661. // CSR defined 64 bit unique ID.
  662.  
  663. struct CSRNodeUniqueIDStruct
  664. {
  665.     UInt32                        hi,
  666.                                 lo;                        // Hi and lo values of 64 bit unique ID.
  667. };
  668. typedef struct CSRNodeUniqueIDStruct
  669.                                 CSRNodeUniqueID,
  670.                                 *CSRNodeUniqueIDPtr;
  671.  
  672. typedef UInt32                    CSRROMEntryIterator;
  673. typedef UInt32                    CSRROMIterationOp;
  674. typedef KernelID                CSRROMEntryID;
  675.  
  676. struct CSRROMSearchCriteriaStruct
  677. {
  678.     UInt32                        csrROMSearchType;        // Type of search record.
  679.     UInt32                        keyType;                // Key types to search for.
  680.     UInt32                        keyHi,                    // Key values to search for.
  681.                                 keyLo;                    //zzz ought to provide nice way to set these.
  682. };
  683. typedef struct CSRROMSearchCriteriaStruct
  684.                                 CSRROMSearchCriteria,
  685.                                 *CSRROMSearchCriteriaPtr;
  686.  
  687. /*zzz End put in IEEE1212.h */
  688.  
  689.  
  690. ////////////////////////////////////////////////////////////////////////////////
  691. //
  692. // FireWire CSR defs.
  693. //
  694.  
  695. // FireWire core CSR registers.
  696.  
  697. enum
  698. {
  699.     kFWCSRStateGone                = kFWBit16,
  700.     kFWCSRStateLinkOff            = kFWBit22,
  701.     kFWCSRStateCMstr            = kFWBit23
  702. };
  703.  
  704. // FireWire bus/nodeID address defs.
  705.  
  706. enum
  707. {
  708.     kFWAddressBusID                = FWBitRange (16, 25) << kCSRNodeIDPhase,
  709.     kFWAddressBusIDPhase        = FWBitRangePhase (16, 25) + kCSRNodeIDPhase,
  710.  
  711.     kFWAddressNodeID            = FWBitRange (26, 31) << kCSRNodeIDPhase,
  712.     kFWAddressNodeIDPhase        = FWBitRangePhase (26, 31) + kCSRNodeIDPhase,
  713.  
  714.     kFWLocalBusID                = 1023,
  715.     kFWBroadcastNodeID            = 63,
  716.  
  717.     kFWLocalBusAddress            = kFWLocalBusID << kFWAddressBusIDPhase,
  718.     kFWBroadcastAddress            = kFWBroadcastNodeID << kFWAddressNodeIDPhase
  719. };
  720.  
  721. #define FWNodeBaseAddress(busID, nodeID)                                                \
  722. (                                                                                        \
  723.     (busID << kFWAddressBusIDPhase) |                                                    \
  724.     (nodeID << kFWAddressNodeIDPhase)                                                    \
  725. )
  726.  
  727. #define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID)                                    \
  728. (                                                                                        \
  729.     FWNodeBaseAddress (busID, nodeID) |                                                    \
  730.     kCSRRegisterSpaceBaseAddressHi                                                        \
  731. )
  732.  
  733.  
  734. // FireWire CSR bus info block defs.
  735.  
  736. enum
  737. {
  738.     kFWBIBHeaderAddress            = kCSRBIBHeaderAddress,
  739.     kFWBIBBusNameAddress        = kCSRBIBBusNameAddress,
  740.     kFWBIBNodeCapabilitiesAddress
  741.                                 = kCSRROMBaseAddress + 8,
  742.     kFWBIBNodeUniqueIDHiAddress    = kCSRROMBaseAddress + 12,
  743.     kFWBIBNodeUniqueIDLoAddress    = kCSRROMBaseAddress + 16,
  744.  
  745.     kFWBIBBusName                = '1394',
  746.  
  747.     kFWBIBIrmc                    = kFWBit0,
  748.     kFWBIBCmc                    = kFWBit1,
  749.     kFWBIBIsc                    = kFWBit2,
  750.     kFWBIBBmc                    = kFWBit3,
  751.     kFWBIBCycClkAcc                = FWBitRange (8, 15),
  752.     kFWBIBCycClkAccPhase        = FWBitRangePhase (8, 15),
  753.     kFWBIBMaxRec                = FWBitRange (16, 19),
  754.     kFWBIBMaxRecPhase            = FWBitRangePhase (16, 19)
  755. };
  756.  
  757.  
  758. ////////////////////////////////////////////////////////////////////////////////
  759. //
  760. // FireWire ID defs.
  761. //
  762.  
  763. typedef KernelID                FWReferenceID;
  764. typedef FWReferenceID            FWIMID;
  765. typedef FWReferenceID            FWDeviceID;
  766. typedef FWReferenceID            FWUnitID;
  767. typedef FWReferenceID            FWClientID;
  768. typedef FWReferenceID            FWDriverID;
  769. typedef FWReferenceID            FWVDeviceID;
  770. typedef FWReferenceID            FWPDriverID;
  771. typedef FWReferenceID            FWIsochResourceManagerID;
  772. typedef KernelID                FWCommandObjectID;
  773. typedef KernelID                FWCommandID;
  774. typedef KernelID                FWIMCommandID;
  775. typedef KernelID                FWClientCommandID;
  776. typedef KernelID                FWIMProcessID;
  777. typedef KernelID                IsochChannelID;
  778. typedef KernelID                IsochPortID;
  779. typedef KernelID                DCLProgramID;
  780. typedef KernelID                FWAddressSpaceID;
  781. typedef KernelID                FWDeferredTaskID;
  782.  
  783. enum
  784. {
  785.     kInvalidFWReferenceID        = 0,                    // zzz should use generic invalid ID
  786.     kInvalidFWIMID                = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWIM
  787.     kInvalidFWDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  788.     kInvalidFWUnitID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  789.     kInvalidFWClientID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  790.     kInvalidFWDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  791.     kInvalidFWVDeviceID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  792.     kInvalidFWPDriverID            = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  793.     kInvalidFWIsochResourceManagerID    = kInvalidFWReferenceID,    // zzz should use generic invalid ID ID for an invalid FWDriver
  794.     kInvalidFWCommandObjectID    = 0,                    // zzz should use generic invalid ID
  795.     kInvalidFWCommandID            = 0,                    // zzz should use generic invalid ID
  796.     kInvalidFWIMCommandID        = 0,                    // zzz should use generic invalid ID
  797.     kInvalidFWClientCommandID    = 0,                    // zzz should use generic invalid ID
  798.     kInvalidFWIMProcessID        = 0,                    // zzz should use generic invalid ID
  799.     kInvalidIsochChannelID        = 0,                    // zzz should use generic invalid ID
  800.     kInvalidIsochPortID            = 0,                    // zzz should use generic invalid ID ID for an invalid FWIM
  801.     kInvalidDCLProgramID        = 0,                    // zzz should use generic invalid ID
  802.     kInvalidFWAddressSpaceID    = 0,                    // zzz should use generic invalid ID
  803.     kInvalidFWDeferredTaskID    = 0                        // zzz should use generic invalid ID
  804. };
  805.  
  806.  
  807. ////////////////////////////////////////////////////////////////////////////////
  808. //
  809. // FireWire deferred task defs.
  810. //
  811.  
  812. typedef void    (FWDeferredTaskProc) (
  813.     void                        *param1,
  814.     void                        *param2);
  815. typedef FWDeferredTaskProc        *FWDeferredTaskProcPtr;
  816.  
  817.  
  818. ////////////////////////////////////////////////////////////////////////////////
  819. //
  820. // Address space defs.
  821. //
  822.  
  823. enum
  824. {
  825.     kFWAddressWriteEnable            = kFWBit31,
  826.     kFWAddressWriteRequestNotify    = kFWBit30,
  827.     kFWAddressWriteCompleteNotify    = kFWBit29,
  828.     kFWAddressReadEnable            = kFWBit28,
  829.     kFWAddressReadRequestNotify        = kFWBit27,
  830.     kFWAddressReadCompleteNotify    = kFWBit26,
  831.     kFWAddressLockEnable            = kFWBit25,
  832.     kFWAddressLockRequestNotify        = kFWBit24,
  833.     kFWAddressLockCompleteNotify    = kFWBit23,
  834.     kFWAddressLocation                = FWBitRange (21, 22),
  835.     kFWAddressLocationPhase            = FWBitRangePhase (21, 22),
  836.     kFWAddressInitialMemorySpace    = 0,
  837.     kFWAddressPrivateSpace            = 1,
  838.     kFWAddressInitialUnitsSpace        = 2,
  839.     kFWAddressOffsetInitialUnitsSpace    = 3
  840. };
  841.  
  842.  
  843. ////////////////////////////////////////////////////////////////////////////////
  844. //
  845. // Isochronous channel defs.
  846. //
  847.  
  848. enum
  849. {
  850.     kFWIsochChannelUnknownCondition        = 0,
  851.     kFWIsochChannelNotEnoughBandwidth    = 1,
  852.     kFWIsochChannelChannelNotAvailable    = 2
  853. };
  854.  
  855. typedef OSStatus    (FWIsochChannelForceStopNotificationProc) (
  856.     IsochChannelID                isochChannelID,
  857.     UInt32                        stopCondition);
  858. typedef FWIsochChannelForceStopNotificationProc
  859.                                 *FWIsochChannelForceStopNotificationProcPtr;
  860.  
  861.  
  862. ////////////////////////////////////////////////////////////////////////////////
  863. //
  864. // Isochronous channel defs.
  865. //
  866.  
  867. enum
  868. {
  869.     kFWDCLImmediateEvent        = 0,
  870.     kFWDCLCycleEvent            = 1,
  871.     kFWDCLSyBitsEvent            = 2
  872. };
  873.  
  874. enum
  875. {
  876.     kFWDCLInvalidNotification    = 0,
  877.     kFWDCLUpdateNotification    = 1,
  878.     kFWDCLModifyNotification    = 2
  879. };
  880.  
  881. enum
  882. {
  883.     kFWDCLOpDynamicFlag            = (1 << 16),
  884.     kFWDCLOpVendorDefinedFlag    = (1 << 17),
  885.     kFWDCLOpFlagMask            = BitRange (16, 31),
  886.     kFWDCLOpFlagPhase            = BitRangePhase (16, 31)
  887. };
  888.  
  889. enum
  890. {
  891.     kDCLInvalidOp                = 0,
  892.     kDCLSendPacketStartOp        = 1,
  893.     kDCLSendPacketWithHeaderStartOp
  894.                                 = 2,
  895.     kDCLSendPacketOp            = 3,
  896.     kDCLSendBufferOp            = 4,
  897.     kDCLReceivePacketStartOp    = 5,
  898.     kDCLReceivePacketOp            = 6,
  899.     kDCLReceiveBufferOp            = 7,
  900.     kDCLCallProcOp                = 8,
  901.     kDCLLabelOp                    = 9,
  902.     kDCLJumpOp                    = 10,
  903.     kDCLSetTagSyncBitsOp        = 11,
  904.     kDCLUpdateDCLListOp            = 12,
  905.     kDCLTimeStampOp                = 13
  906. };
  907.  
  908. typedef struct DCLCommandStruct
  909.                                 DCLCommand,
  910.                                 *DCLCommandPtr;
  911.  
  912. struct DCLCommandStruct
  913. {
  914.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  915.     UInt32                        compilerData;            // Data for use by DCL compiler.
  916.     UInt32                        opcode;                    // DCL opcode.
  917.     UInt32                        operands[1];            // DCL operands.
  918. };
  919.  
  920. struct DCLTransferPacketStruct
  921. {
  922.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  923.     UInt32                        compilerData;            // Data for use by DCL compiler.
  924.     UInt32                        opcode;                    // DCL opcode.
  925.     Ptr                            buffer;                    // Packet buffer.
  926.     UInt32                        size;                    // Buffer size.
  927. };
  928. typedef struct DCLTransferPacketStruct
  929.                                 DCLTransferPacket,
  930.                                 *DCLTransferPacketPtr;
  931.  
  932. struct DCLTransferBufferStruct
  933. {
  934.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  935.     UInt32                        compilerData;            // Data for use by DCL compiler.
  936.     UInt32                        opcode;                    // DCL opcode.
  937.     Ptr                            buffer;                    // Buffer.
  938.     UInt32                        size;                    // Buffer size.
  939.     UInt16                        packetSize;                // Size of packets to send.
  940.     UInt16                        reserved;
  941.     UInt32                        bufferOffset;            // Current offset into buffer.
  942. };
  943. typedef struct DCLTransferBufferStruct
  944.                                 DCLTransferBuffer,
  945.                                 *DCLTransferBufferPtr;
  946.  
  947. typedef void    (DCLCallCommandProc) (
  948.     DCLCommandPtr                pDCLCommand);
  949. typedef DCLCallCommandProc        *DCLCallCommandProcPtr;
  950.  
  951. struct DCLCallProcStruct
  952. {
  953.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  954.     UInt32                        compilerData;            // Data for use by DCL compiler.
  955.     UInt32                        opcode;                    // DCL opcode.
  956.     DCLCallCommandProcPtr        proc;                    // Procedure to call.
  957.     UInt32                        procData;                // Data for use by called procedure.
  958. };
  959. typedef struct DCLCallProcStruct
  960.                                 DCLCallProc,
  961.                                 *DCLCallProcPtr;
  962.  
  963. struct DCLLabelStruct
  964. {
  965.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  966.     UInt32                        compilerData;            // Data for use by DCL compiler.
  967.     UInt32                        opcode;                    // DCL opcode.
  968. };
  969. typedef struct DCLLabelStruct
  970.                                 DCLLabel,
  971.                                 *DCLLabelPtr;
  972.  
  973. struct DCLJumpStruct
  974. {
  975.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  976.     UInt32                        compilerData;            // Data for use by DCL compiler.
  977.     UInt32                        opcode;                    // DCL opcode.
  978.     DCLLabelPtr                    pJumpDCLLabel;            // DCL label to jump to.
  979. };
  980. typedef struct DCLJumpStruct
  981.                                 DCLJump,
  982.                                 *DCLJumpPtr;
  983.  
  984. struct DCLSetTagSyncBitsStruct
  985. {
  986.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  987.     UInt32                        compilerData;            // Data for use by DCL compiler.
  988.     UInt32                        opcode;                    // DCL opcode.
  989.     UInt16                        tagBits;                // Tag bits for following packets.
  990.     UInt16                        syncBits;                // Sync bits for following packets.
  991. };
  992. typedef struct DCLSetTagSyncBitsStruct
  993.                                 DCLSetTagSyncBits,
  994.                                 *DCLSetTagSyncBitsPtr;
  995.  
  996. struct DCLUpdateDCLListStruct
  997. {
  998.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  999.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1000.     UInt32                        opcode;                    // DCL opcode.
  1001.     DCLCommandPtr                *dclCommandList;        // List of DCL commands to update.
  1002.     UInt32                        numDCLCommands;            // Number of DCL commands in list.
  1003. };
  1004. typedef struct DCLUpdateDCLListStruct
  1005.                                 DCLUpdateDCLList,
  1006.                                 *DCLUpdateDCLListPtr;
  1007.  
  1008. struct DCLTimeStampStruct
  1009. {
  1010.     DCLCommandPtr                pNextDCLCommand;        // Next DCL command.
  1011.     UInt32                        compilerData;            // Data for use by DCL compiler.
  1012.     UInt32                        opcode;                    // DCL opcode.
  1013.     UInt32                        timeStamp;                // Time stamp.
  1014. };
  1015. typedef struct DCLTimeStampStruct
  1016.                                 DCLTimeStamp,
  1017.                                 *DCLTimeStampPtr;
  1018.  
  1019. typedef OSStatus    (DCLProgramStartProc) (
  1020.     DCLProgramID                dclProgramID);
  1021. typedef DCLProgramStartProc        *DCLProgramStartProcPtr;
  1022.  
  1023. typedef OSStatus    (DCLProgramStopProc) (
  1024.     DCLProgramID                dclProgramID);
  1025. typedef DCLProgramStopProc        *DCLProgramStopProcPtr;
  1026.  
  1027. typedef OSStatus    (DCLProgramReleaseProc) (
  1028.     DCLProgramID                dclProgramID);
  1029. typedef DCLProgramReleaseProc    *DCLProgramReleaseProcPtr;
  1030.  
  1031. typedef OSStatus    (DCLCompilerNotificationProc) (
  1032.     DCLProgramID                dclProgramID,
  1033.     UInt32                        notificationType,
  1034.     DCLCommandPtr                *dclCommandList,
  1035.     UInt32                        numDCLCommands);
  1036. typedef DCLCompilerNotificationProc
  1037.                                 *DCLCompilerNotificationProcPtr;
  1038.  
  1039.  
  1040. ////////////////////////////////////////////////////////////////////////////////
  1041. //
  1042. // Define some bus management constants.
  1043. //
  1044.  
  1045. enum
  1046. {
  1047.     kFWBusManagerArbitrationTimeoutDuration
  1048.                                 = 625 * durationMillisecond
  1049. };
  1050.  
  1051.  
  1052. ////////////////////////////////////////////////////////////////////////////////
  1053. //
  1054. // Define some bus characteristics.
  1055. //
  1056.  
  1057. enum
  1058. {
  1059.     kFWMaxBusses                = 1023,
  1060.     kFWMaxNodesPerBus            = 63,
  1061.     kFWMaxNodeHops                = 16
  1062. };
  1063.  
  1064.  
  1065. ////////////////////////////////////////////////////////////////////////////////
  1066. //
  1067. // Packet defs.
  1068. //
  1069.  
  1070. // Phy packet defs.
  1071.  
  1072. enum
  1073. {
  1074.     kFWPhyPacketID                = FWBitRange (0, 1),
  1075.     kFWPhyPacketIDPhase            = FWBitRangePhase (0, 1),
  1076.  
  1077.     kFWPhyPacketPhyID            = FWBitRange (2, 7),
  1078.     kFWPhyPacketPhyIDPhase        = FWBitRangePhase (2, 7)
  1079. };
  1080.  
  1081. enum
  1082. {
  1083.     kSelfIDPacketSize            = 8,//zzz add FW
  1084.     kMaxSelfIDPacketsPerNode    = 9//zzz add FW
  1085. };
  1086.  
  1087. enum
  1088. {
  1089.     kFWConfigurationPacketID    = 0,
  1090.     kFWLinkOnPacketID            = 1,
  1091.     kFWSelfIDPacketID            = 2
  1092. };
  1093.  
  1094. enum
  1095. {
  1096.     kFWPhyConfigurationR        = kFWBit8,
  1097.     kFWPhyConfigurationT        = kFWBit9,
  1098.     kFWPhyConfigurationGapCnt    = FWBitRange (10, 15),
  1099.     kFWPhyConfigurationGapCntPhase
  1100.                                 = FWBitRangePhase (10, 15)
  1101. };
  1102.  
  1103. enum
  1104. {
  1105.     kFWSelfIDPortStatusChild    = 3,
  1106.     kFWSelfIDPortStatusParent    = 2,
  1107.     kFWSelfIDPortStatusNotConnected    = 1,
  1108.     kFWSelfIDPortStatusNotPresent    = 0,
  1109.  
  1110.     kFWSelfIDNoPower            = 0,
  1111.     kFWSelfIDSelfPowered15W        = 1,
  1112.     kFWSelfIDSelfPowered30W        = 2,
  1113.     kFWSelfIDSelfPowered45W        = 3,
  1114.     kFWSelfIDBusPowered1W        = 4,
  1115.     kFWSelfIDBusPowered3W        = 5,
  1116.     kFWSelfIDBusPowered6W        = 6,
  1117.     kFWSelfIDBusPowered10W        = 7,
  1118.  
  1119.     kFWSelfIDPhyID                = kFWPhyPacketPhyID,//zzz do we need or want this?
  1120.     kFWSelfIDPhyIDPhase            = kFWPhyPacketPhyIDPhase,
  1121.     kFWSelfIDM                    = kFWBit31,
  1122.  
  1123.     kFWSelfID0L                    = kFWBit9,
  1124.     kFWSelfID0GapCnt            = FWBitRange (10, 15),
  1125.     kFWSelfID0GapCntPhase        = FWBitRangePhase (10, 15),
  1126.     kFWSelfID0SP                = FWBitRange (16, 17),
  1127.     kFWSelfID0SPPhase            = FWBitRangePhase (16, 17),
  1128.     kFWSelfID0Del                = FWBitRange (18, 19),
  1129.     kFWSelfID0DelPhase            = FWBitRangePhase (18, 19),
  1130.     kFWSelfID0C                    = kFWBit20,
  1131.     kFWSelfID0Pwr                = FWBitRange (21, 23),
  1132.     kFWSelfID0PwrPhase            = FWBitRangePhase (21, 23),
  1133.     kFWSelfID0P0                = FWBitRange (24, 25),
  1134.     kFWSelfID0P0Phase            = FWBitRangePhase (24, 25),
  1135.     kFWSelfID0P1                = FWBitRange (26, 27),
  1136.     kFWSelfID0P1Phase            = FWBitRangePhase (26, 27),
  1137.     kFWSelfID0P2                = FWBitRange (28, 29),
  1138.     kFWSelfID0P2Phase            = FWBitRangePhase (28, 29),
  1139.     kFWSelfID0I                    = kFWBit30,
  1140.  
  1141.     kFWSelfIDNN                    = FWBitRange (10, 11),
  1142.     kFWSelfIDNNPhase            = FWBitRangePhase (10, 11),
  1143.     kFWSelfIDNPa                = FWBitRange (14, 15),
  1144.     kFWSelfIDNPaPhase            = FWBitRangePhase (14, 15),
  1145.     kFWSelfIDNPb                = FWBitRange (16, 17),
  1146.     kFWSelfIDNPbPhase            = FWBitRangePhase (16, 17),
  1147.     kFWSelfIDNPc                = FWBitRange (18, 19),
  1148.     kFWSelfIDNPcPhase            = FWBitRangePhase (18, 19),
  1149.     kFWSelfIDNPd                = FWBitRange (20, 21),
  1150.     kFWSelfIDNPdPhase            = FWBitRangePhase (20, 21),
  1151.     kFWSelfIDNPe                = FWBitRange (22, 23),
  1152.     kFWSelfIDNPePhase            = FWBitRangePhase (22, 23),
  1153.     kFWSelfIDNPf                = FWBitRange (24, 25),
  1154.     kFWSelfIDNPfPhase            = FWBitRangePhase (24, 25),
  1155.     kFWSelfIDNPg                = FWBitRange (26, 27),
  1156.     kFWSelfIDNPgPhase            = FWBitRangePhase (26, 27),
  1157.     kFWSelfIDNPh                = FWBitRange (28, 29),
  1158.     kFWSelfIDNPhPhase            = FWBitRangePhase (28, 29)
  1159. };
  1160.  
  1161. // Primary packet defs.
  1162.  
  1163. enum
  1164. {
  1165.     kFWSpeed100MBit                = 0,
  1166.     kFWSpeed200MBit                = 1,
  1167.     kFWSpeed400MBit                = 2,
  1168.     kFWSpeedMaximum                = 0x7FFFFFFF,            //zzz what are the best numbers???
  1169.     kFWSpeedInvalid                = 0x80000000
  1170. };
  1171.  
  1172. enum
  1173. {
  1174.     kFWTCodeWriteQuadlet        = 0,
  1175.     kFWTCodeWriteBlock            = 1,
  1176.     kFWTCodeWriteResponse        = 2,
  1177.     kFWTCodeReadQuadlet            = 4,
  1178.     kFWTCodeReadBlock            = 5,
  1179.     kFWTCodeReadQuadletResponse    = 6,
  1180.     kFWTCodeReadBlockResponse    = 7,
  1181.     kFWTCodeCycleStart            = 8,
  1182.     kFWTCodeLock                = 9,
  1183.     kFWTCodeIsochronousBlock    = 10,
  1184.     kFWTCodeLockResponse        = 11
  1185. };
  1186.  
  1187. enum
  1188. {
  1189.     kFWExtendedTCodeMaskSwap    = 1,
  1190.     kFWExtendedTCodeCompareSwap    = 2,
  1191.     kFWExtendedTCodeFetchAdd    = 3,
  1192.     kFWExtendedTCodeLittleAdd    = 4,
  1193.     kFWExtendedTCodeBoundedAdd    = 5,
  1194.     kFWExtendedTCodeWrapAdd        = 6,
  1195.     kFWExtendedTCodeVendorDependent    = 7
  1196. };
  1197.  
  1198. enum
  1199. {
  1200.     kFWResponseComplete            = 0,
  1201.     kFWResponseConflictError    = 4,
  1202.     kFWResponseDataError        = 5,
  1203.     kFWResponseTypeError        = 6,
  1204.     kFWResponseAddressError        = 7
  1205. };
  1206.  
  1207. enum
  1208. {
  1209.     kFWAckComplete                = 1,
  1210.     kFWAckPending                = 2,
  1211.     kFWAckBusyX                    = 3,
  1212.     kFWAckBusyA                    = 4,
  1213.     kFWAckBusyB                    = 5,
  1214.     kFWAckDataError                = 13,
  1215.     kFWAckTypeError                = 14
  1216. };
  1217.  
  1218.  
  1219. enum
  1220. {
  1221.     kFWIsochDataLength            = FWBitRange (0, 15),
  1222.     kFWIsochDataLengthPhase        = FWBitRangePhase (0, 15),
  1223.     
  1224.     kFWIsochTag                    = FWBitRange (16, 17),
  1225.     kFWIsochTagPhase            = FWBitRangePhase (16, 17),
  1226.  
  1227.     kFWIsochChanNum                = FWBitRange (18, 23),
  1228.     kFWIsochChanNumPhase        = FWBitRangePhase (18, 23),
  1229.  
  1230.     kFWIsochTCode                = FWBitRange (24, 27),
  1231.     kFWIsochTCodePhase            = FWBitRangePhase (24, 27),
  1232.  
  1233.     kFWIsochSy                    = FWBitRange (28, 31),
  1234.     kFWIsochSyPhase                = FWBitRangePhase (28, 31)
  1235. };
  1236.  
  1237.  
  1238. // Topology map.
  1239.  
  1240. enum
  1241. {
  1242.     kFWTopologyMapMaxSelfIDs    = kFWMaxNodesPerBus * kMaxSelfIDPacketsPerNode
  1243. };
  1244.  
  1245. struct FWTopologyMapStruct
  1246. {
  1247.     UInt16                        length;
  1248.     UInt16                        CRC;
  1249.     UInt32                        generationNumber;
  1250.     UInt16                        nodeCount;
  1251.     UInt16                        selfIDCount;
  1252.     UInt32                        selfIDs[kFWTopologyMapMaxSelfIDs];
  1253. };
  1254. typedef struct FWTopologyMapStruct
  1255.                                 FWTopologyMap,
  1256.                                 *FWTopologyMapPtr;
  1257.  
  1258. // Speed map.
  1259.  
  1260. enum
  1261. {
  1262.     kFWSpeedMapMaxSpeedCodes    = (kFWMaxNodesPerBus + 1) * (kFWMaxNodesPerBus - 1) +
  1263.                                   (kFWMaxNodesPerBus - 1)
  1264. };
  1265.  
  1266. struct FWSpeedMapStruct
  1267. {
  1268.     UInt16                        length;
  1269.     UInt16                        CRC;
  1270.     UInt32                        generationNumber;
  1271.     UInt8                        speedCodes[kFWSpeedMapMaxSpeedCodes];
  1272. };
  1273. typedef struct FWSpeedMapStruct    FWSpeedMap,
  1274.                                 *FWSpeedMapPtr;
  1275.  
  1276. ////////////////////////////////////////////////////////////////////////////////
  1277. //
  1278. // FireWire client defs.
  1279. //
  1280.  
  1281. enum
  1282. {
  1283.     kFWClientCommandQueueActiveBit    = 0,
  1284.     kFWClientCommandQueueActiveByte    = 1,
  1285.     kFWClientCommandQueueActive        = (1 << kFWClientCommandQueueActiveBit)
  1286. };
  1287.  
  1288. enum
  1289. {
  1290.     kFWClientCommandBusy        = 1,
  1291.     kFWClientCommandWaiting        = 2
  1292. };
  1293.  
  1294. enum
  1295. {
  1296.     kFWClientCommandSyncFlag    = (1 << 0),
  1297.     kFWClientCommandImmediateFlag    = (1 << 1)
  1298. };
  1299.  
  1300. enum
  1301. {
  1302.     kFWClientCommandAcceptNoMore
  1303.                                 = 0,
  1304.     kFWClientCommandAcceptMore    = 1,
  1305.     kFWClientCommandRejected    = 2
  1306. };
  1307.  
  1308. enum
  1309. {
  1310.     kFWClientResetNotify        = 1,                    // Notify client that a reset occured.
  1311.     kFWClientBusManagementNotify    = 2,                // Notify client that a reset occured and bus management has been established.
  1312.     kFWClientReadRequest        = 3,                    // Read request from client's address space.
  1313.     kFWClientReadComplete        = 4,                    // Read complete from client's address space.
  1314.     kFWClientWriteRequest        = 5,                    // Write request to a client's address space.
  1315.     kFWClientWriteComplete        = 6,                    // Write complete to a client's address space.
  1316.     kFWClientLockRequest        = 7,                    // Lock request to a client's address space.
  1317.     kFWClientLockComplete        = 8,                    // Lock complete to a client's address space.
  1318.     kFWClientInitIsochPort        = 9,                    // Initialize an isochronous port.
  1319.     kFWClientReleaseIsochPort    = 10,                    // Release resources allocated for isochronous port.
  1320.     kFWClientStartIsochPort        = 11,                    // Start data flow through isoch port.
  1321.     kFWClientStopIsochPort        = 12                    // Stop data flow through isoch port.
  1322. };
  1323.  
  1324.  
  1325. // Define FireWire Client command param structures.
  1326.  
  1327. typedef struct FWClientInterfaceParamsStruct
  1328.                                 FWClientInterfaceParams,
  1329.                                 *FWClientInterfaceParamsPtr;
  1330.  
  1331. typedef void    (FWClientCommandCompletionProc) (
  1332.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams);
  1333. typedef FWClientCommandCompletionProc
  1334.                                 *FWClientCommandCompletionProcPtr;
  1335.  
  1336. struct FWClientInterfaceParamsStruct
  1337. {
  1338.     UInt32                        interfaceSelector;        // Selector indicating the type of request.
  1339.     FWReferenceID                fwReferenceID;            // Reference to target of command.
  1340.     FWClientCommandID            fwClientCommandID;        // ID for this command.
  1341.     UInt32                        fwClientSpecificData;    // Data specific to the FireWire client.
  1342. };
  1343.  
  1344. struct FWClientAsynchRequestParamsStruct
  1345. {
  1346.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1347.     UInt32                        generation;                // Generation number that request was received on.
  1348.     Ptr                            receiveBuffer;            // Pointer to buffer with receive data.
  1349.     Ptr                            transmitBuffer;            // Pointer to buffer with transmit data.
  1350.     UInt16                        sourceID;                // Node ID of source of the request.
  1351.     UInt16                        responseCode;            // Response code.
  1352.     UInt32                        offset;                    // Offset of request within target address space.
  1353.     UInt16                        length;                    // Length of request.
  1354.     UInt16                        extendedTCode;            // Extended transaction code.
  1355.     FWAddressSpaceID            fwAddressSpaceID;        // ID of the target address space.
  1356.     Ptr                            pAddressSpecificData;    // Pointer to data specific to the address space.
  1357. };
  1358. typedef struct FWClientAsynchRequestParamsStruct
  1359.                                 FWClientAsynchRequestParams,
  1360.                                 *FWClientAsynchRequestParamsPtr;
  1361.  
  1362. struct FWClientIsochPortParamsStruct
  1363. {
  1364.     IsochChannelID                isochChannelID;            // Reference to the channel that this port belongs to.
  1365.     UInt32                        refCon;                    // Reference constant for specific port.
  1366.     Boolean                        portIsTalker;            // Boolean indicating that this channel is the talker.
  1367. };
  1368. typedef struct FWClientIsochPortParamsStruct
  1369.                                 FWClientIsochPortParams,
  1370.                                 *FWClientIsochPortParamsPtr;
  1371.  
  1372. struct FWClientInitIsochPortParamsStruct
  1373. {
  1374.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1375.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1376.     UInt32                        channelNum;                // Channel number for port.
  1377.     UInt32                        supportedChannelNumHi,    // Channel numbers supported by port.
  1378.                                 supportedChannelNumLo;
  1379.     UInt32                        speed;                    // Speed of channel.
  1380.     Boolean                        trial;                    // Boolean indicating that this call is just a trial.
  1381. };
  1382. typedef struct FWClientInitIsochPortParamsStruct
  1383.                                 FWClientInitIsochPortParams,
  1384.                                 *FWClientInitIsochPortParamsPtr;
  1385.  
  1386. struct FWClientReleaseIsochPortParamsStruct
  1387. {
  1388.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1389.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1390. };
  1391. typedef struct FWClientReleaseIsochPortParamsStruct
  1392.                                 FWClientReleaseIsochPortParams,
  1393.                                 *FWClientReleaseIsochPortParamsPtr;
  1394.  
  1395. struct FWClientIsochPortControlParamsStruct
  1396. {
  1397.     FWClientInterfaceParams        fwClientInterfaceParams;    // Common set of interface params.
  1398.     FWClientIsochPortParams        fwClientIsochPortParams;    // Params for all isoch port requests.
  1399. };
  1400. typedef struct FWClientIsochPortControlParamsStruct
  1401.                                 FWClientIsochPortControlParams,
  1402.                                 *FWClientIsochPortControlParamsPtr;
  1403.  
  1404.  
  1405. // Define FireWire Client procs.
  1406.  
  1407. typedef OSStatus    (FWClientInterfaceProc) (
  1408.     FWClientInterfaceParamsPtr    pFWClientInterfaceParams,
  1409.     UInt32                        *pCommandAcceptance);
  1410. typedef FWClientInterfaceProc    *FWClientInterfaceProcPtr;
  1411.  
  1412. typedef FWClientInterfaceProc    FWClientResetNotifyProc,
  1413.                                 *FWClientResetNotifyProcPtr;
  1414.  
  1415. typedef OSStatus    (FWClientReadProc) (
  1416.     FWClientAsynchRequestParamsPtr
  1417.                                 pAsynchRequestParams,
  1418.     UInt32                        *pCommandAcceptance);
  1419. typedef FWClientReadProc        *FWClientReadProcPtr;
  1420.  
  1421. typedef OSStatus    (FWClientWriteProc) (
  1422.     FWClientAsynchRequestParamsPtr
  1423.                                 pAsynchRequestParams,
  1424.     UInt32                        *pCommandAcceptance);
  1425. typedef FWClientWriteProc        *FWClientWriteProcPtr;
  1426.  
  1427. typedef OSStatus    (FWClientLockProc) (
  1428.     FWClientAsynchRequestParamsPtr
  1429.                                 pAsynchRequestParams,
  1430.     UInt32                        *pCommandAcceptance);
  1431. typedef FWClientLockProc        *FWClientLockProcPtr;
  1432.  
  1433. typedef OSStatus    (FWClientInitIsochPortProc) (
  1434.     FWClientInitIsochPortParamsPtr
  1435.                                 pInitIsochPortParams,
  1436.     UInt32                        *pCommandAcceptance);
  1437. typedef FWClientInitIsochPortProc
  1438.                                 *FWClientInitIsochPortProcPtr;
  1439.  
  1440. typedef OSStatus    (FWClientReleaseIsochPortProc) (
  1441.     FWClientReleaseIsochPortParamsPtr
  1442.                                 pReleaseIsochPortParams,
  1443.     UInt32                        *pCommandAcceptance);
  1444. typedef FWClientReleaseIsochPortProc
  1445.                                 *FWClientReleaseIsochPortProcPtr;
  1446.  
  1447. typedef OSStatus    (FWClientStartIsochPortProc) (
  1448.     FWClientIsochPortControlParamsPtr
  1449.                                 pIsochPortControlParams,
  1450.     UInt32                        *pCommandAcceptance);
  1451. typedef FWClientStartIsochPortProc
  1452.                                 *FWClientStartIsochPortProcPtr;
  1453.  
  1454. typedef OSStatus    (FWClientStopIsochPortProc) (
  1455.     FWClientIsochPortControlParamsPtr
  1456.                                 pIsochPortControlParams,
  1457.     UInt32                        *pCommandAcceptance);
  1458. typedef FWClientStopIsochPortProc
  1459.                                 *FWClientStopIsochPortProcPtr;
  1460.  
  1461.  
  1462. ////////////////////////////////////////////////////////////////////////////////
  1463. //
  1464. // Gestalt defs - JKL: need to go into MasterInterfaces Gestalt.i
  1465. //
  1466.  
  1467. enum {
  1468.     gestaltFireWireVersion        = 'fwve',        /* FireWire version */
  1469.     kFireWireVersion            = 0x0101,        /* current version is 1.0.1 */
  1470.     gestaltFireWireAttr            = 'fwat',        /* FireWire attributes */
  1471.     gestaltHasFireWirePorts        = 0                /* bit 0 set to 1 if FireWire hardware is detected */
  1472. };
  1473.  
  1474. ////////////////////////////////////////////////////////////////////////////////
  1475. //
  1476. // FWIM defs.
  1477. //
  1478.  
  1479. // Define FWIM command types.
  1480.  
  1481. enum
  1482. {
  1483.     kFWIMSendLinkOnPacket
  1484.                                 = 1,                    // Send a phy configuration packet.
  1485.     kFWIMSendPhyConfigurationPacket
  1486.                                 = 2,                    // Send a phy configuration packet.
  1487.     kFWIMRead                    = 3,                    // Perform a read transaction.
  1488.     kFWIMReadResponse            = 4,                    // Transmit a read response.
  1489.     kFWIMWrite                    = 5,                    // Perform a write transaction.
  1490.     kFWIMWriteResponse            = 6,                    // Transmit a write response.
  1491.     kFWIMLock                    = 7,                    // Perform a lock transaction.
  1492.     kFWIMLockResponse            = 8,                    // Transmit a lock response.
  1493.     kFWIMAllocateIsochPort        = 9,                    // Allocate an isochronous port.
  1494.     kFWIMReleaseIsochPort        = 10,                    // Release resources allocated for an isochronous port.
  1495.     kFWIMStartIsochPort            = 11,                    // Start isochronous port.
  1496.     kFWIMStopIsochPort            = 12,                    // Stop isochronous port.
  1497.     kFWIMResetBus                = 13,                    // Reset the FireWire bus.
  1498.     kFWIMSetContenderBit        = 14,                    // Set the contender bit on the next bus reset.
  1499.     kFWIMClearContenderBit        = 15,                    // Clear the contender bit on the next bus reset.
  1500.     kFWIMEnableCycleMaster        = 16,                    // Enable cycle mastering.
  1501.     kFWIMDisableCycleMaster        = 17,                    // Disable cycle mastering.
  1502.     kFWIMSetRootHoldoffBit        = 18,                    // Set the root holdoff bit.
  1503.     kFWIMClearRootHoldoffBit    = 19,                    // Clear the root holdoff bit.
  1504.     kFWIMGetUniqueID            = 20                    // Get the local unique ID.
  1505. };
  1506.  
  1507.  
  1508. // Defs for calls from the FWIM interface.
  1509.  
  1510. enum
  1511. {
  1512.     kFWIMProcessSelfIDs            = 1,
  1513.     kFWIMProcessRead            = 2,
  1514.     kFWIMProcessWrite            = 3,
  1515.     kFWIMProcessLock            = 4
  1516. };
  1517.  
  1518. // Defs for calls to the FWIM interface.
  1519. //zzz some of this stuff should be private
  1520.  
  1521. enum
  1522. {
  1523.     kFWIMCommandSyncFlag        = (1 << 0),                // Perform FWIM command synchronously.
  1524.     kFWIMCommandPriorityFlag    = (1 << 1),                // This is a priority command.
  1525.     kFWIMCommandImmediateFlag    = (1 << 2)                // Perform FWIM command immediately.
  1526. };
  1527.  
  1528. enum
  1529. {
  1530.     kFWIMCommandQueueActiveBit    = 0,
  1531.     kFWIMCommandQueueActiveByte    = 1,
  1532.     kFWIMCommandQueueActive        = (1 << kFWIMCommandQueueActiveBit),
  1533.  
  1534.     kFWIMCommandQueueDisabledBit    = 1,
  1535.     kFWIMCommandQueueDisabledByte    = 1,
  1536.     kFWIMCommandQueueDisabled        = (1 << kFWIMCommandQueueDisabledBit)
  1537. };
  1538.  
  1539. enum
  1540. {
  1541.     kFWIMCommandBusy            = 1
  1542. };
  1543.  
  1544. enum
  1545. {
  1546.     kFWIMCommandAcceptNoMore    = 0,
  1547.     kFWIMCommandAcceptMore        = 1,
  1548.     kFWIMCommandRejected        = 2
  1549. };
  1550.  
  1551. typedef struct FWIMCommandParamsStruct
  1552.                                 FWIMCommandParams,
  1553.                                 *FWIMCommandParamsPtr;
  1554.  
  1555. typedef void    (FWIMCommandCompletionProc) (
  1556.     FWIMCommandParamsPtr        pFWIMCommandParams);
  1557. typedef FWIMCommandCompletionProc
  1558.                                 *FWIMCommandCompletionProcPtr;
  1559.  
  1560. struct FWIMInitializeParamsStruct
  1561. {
  1562.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1563.     FWIMID                        fwimID;                    // ID for this FWIM
  1564.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1565. };
  1566. typedef struct FWIMInitializeParamsStruct
  1567.                                 FWIMInitializeParams,
  1568.                                 *FWIMInitializeParamsPtr;
  1569.  
  1570. struct FWIMFinalizeParamsStruct
  1571. {
  1572.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1573.     FWIMID                        fwimID;                    // ID for this FWIM
  1574.     RegEntryID                    fwimRegEntryID;            // Name registry entry for FireWire bus device
  1575. };
  1576. typedef struct FWIMFinalizeParamsStruct
  1577.                                 FWIMFinalizeParams,
  1578.                                 *FWIMFinalizeParamsPtr;
  1579.  
  1580. struct FWIMPollInterruptsParamsStruct
  1581. {
  1582.     UInt32                        fwimSpecificData;        // Data specific to FWIM
  1583.     FWIMID                        fwimID;                    // ID for this FWIM
  1584. };
  1585. typedef struct FWIMPollInterruptsParamsStruct
  1586.                                 FWIMPollInterruptsParams,
  1587.                                 *FWIMPollInterruptsParamsPtr;
  1588.  
  1589. struct FWIMCommandParamsStruct
  1590. {
  1591.     UInt32                        commandType;            // Type of command.
  1592.     FWIMID                        fwimID;                    // Reference to target FWIM.
  1593.     UInt32                        fwimSpecificData;        // Data specific to FWIM.
  1594.     FWIMCommandID                fwimCommandID;            // ID for this command.
  1595. };
  1596.  
  1597. struct FWIMGetUniqueIDParamsStruct
  1598. {
  1599.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1600.     CSRNodeUniqueID                uniqueID;                // Local unique ID.
  1601. };
  1602. typedef struct FWIMGetUniqueIDParamsStruct
  1603.                                 FWIMGetUniqueIDParams,
  1604.                                 *FWIMGetUniqueIDParamsPtr;
  1605.  
  1606. struct FWIMSendPhyPacketParamsStruct
  1607. {
  1608.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1609.     UInt32                        generation;                // FireWire bus generation number.
  1610.     Ptr                            buffer;                    // Buffer with phy packet data.
  1611.     UInt32                        length;                    // Length of packet data.
  1612.     UInt32                        commandStorage;            // Most common phy packets only need 4 bytes.
  1613. };
  1614. typedef struct FWIMSendPhyPacketParamsStruct
  1615.                                 FWIMSendPhyPacketParams,
  1616.                                 *FWIMSendPhyPacketParamsPtr;
  1617.  
  1618. struct FWIMAsynchCommandParamsStruct
  1619. {
  1620.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1621.     Duration                    timeout;                // Split transaction timeout.
  1622.     UInt32                        generation;                // FireWire bus generation number.
  1623.     Ptr                            buffer;                    // Local buffer to read/write into/from
  1624.     UInt8                        numRetries;                // Number of retries left.
  1625.     UInt8                        speed;                    // Transmission speed.
  1626.     UInt16                        reserved;
  1627.     UInt32                        addressHi,
  1628.                                 addressLo;                // FireWire bus address to read/write from/to
  1629.     UInt16                        length;                    // Length of read/write
  1630.     UInt16                        extendedTCode;            // Extended transaction code.
  1631. };
  1632. typedef struct FWIMAsynchCommandParamsStruct
  1633.                                 FWIMAsynchCommandParams,
  1634.                                 *FWIMAsynchCommandParamsPtr;
  1635.  
  1636. enum
  1637. {
  1638.     kFWTransactionDescriptorTLabel        = FWBitRange (16, 21),
  1639.     kFWTransactionDescriptorTLabelPhase    = FWBitRangePhase (16, 21)
  1640. };
  1641.  
  1642. enum //zzz need FWBitRange16
  1643. {
  1644.     kFWResponseDataRCode        = FWBitRange (16, 19),
  1645.     kFWResponseDataRCodePhase    = FWBitRangePhase (16, 19)
  1646. };
  1647.  
  1648. struct FWIMAsynchResponseCommandParamsStruct
  1649. {
  1650.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1651.     AbsoluteTime                timeout;                // Timeout for this response.
  1652.     UInt32                        generation;                // Topology map generation number this response is valid for.
  1653.     Ptr                            buffer;                    // Response buffer.
  1654.     UInt8                        numRetries;                // Number of retries left.
  1655.     UInt8                        speed;                    // Transmission speed.
  1656.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  1657.     UInt16                        destinationID;            // Destination node ID for this response.
  1658.     UInt16                        responseDataHi;            // Response data for transaction.
  1659.     UInt32                        responseDataLo;
  1660.     UInt16                        length;                    // Length of response data.
  1661.     UInt16                        extendedTCode;            // Extended transaction code for this response.
  1662. };
  1663. typedef struct FWIMAsynchResponseCommandParamsStruct
  1664.                                 FWIMAsynchResponseCommandParams,
  1665.                                 *FWIMAsynchResponseCommandParamsPtr;
  1666.  
  1667. struct FWIMIsochPortCommandParamsStruct
  1668. {
  1669.     IsochPortID                    isochPortID;            // Isochronous port ID.
  1670.     UInt32                        fwimIsochPortData;        // Data for FWIM to use for this isoch port.
  1671. };
  1672. typedef struct FWIMIsochPortCommandParamsStruct
  1673.                                 FWIMIsochPortCommandParams,
  1674.                                 *FWIMIsochPortCommandParamsPtr;
  1675.  
  1676. struct FWIMAllocateIsochPortParamsStruct
  1677. {
  1678.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1679.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1680.     DCLProgramID                dclProgramID;            // DCL program for this port.
  1681.     UInt32                        channelNum;                // Isochronous channel number.
  1682.     UInt32                        speed;                    // Speed to use for channel.
  1683.     Boolean                        talking;                // Buffer is for talking (listening if false).
  1684. };
  1685. typedef struct FWIMAllocateIsochPortParamsStruct
  1686.                                 FWIMAllocateIsochPortParams,
  1687.                                 *FWIMAllocateIsochPortParamsPtr;
  1688.  
  1689. struct FWIMReleaseIsochPortParamsStruct
  1690. {
  1691.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1692.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1693. };
  1694. typedef struct FWIMReleaseIsochPortParamsStruct
  1695.                                 FWIMReleaseIsochPortParams,
  1696.                                 *FWIMReleaseIsochPortParamsPtr;
  1697.  
  1698. struct FWIMIsochPortControlParamsStruct
  1699. {
  1700.     FWIMCommandParams            fwimCommandParams;        // Common command params.
  1701.     FWIMIsochPortCommandParams    fwimIsochPortCommandParams;    // Common isoch port request params.
  1702. };
  1703. typedef struct FWIMIsochPortControlParamsStruct
  1704.                                 FWIMIsochPortControlParams,
  1705.                                 *FWIMIsochPortControlParamsPtr;
  1706.  
  1707. // Define FWIM plug in dispatch table.
  1708.  
  1709. typedef OSStatus (FWIMInitializeProc) (
  1710.     FWIMInitializeParamsPtr        pFWIMInitializeParams);
  1711. typedef FWIMInitializeProc        *FWIMInitializeProcPtr;
  1712.  
  1713. typedef OSStatus (FWIMFinalizeProc) (
  1714.     FWIMFinalizeParamsPtr        pFWIMFinalizeParams);
  1715. typedef FWIMFinalizeProc        *FWIMFinalizeProcPtr;
  1716.  
  1717. typedef OSStatus (FWIMPollInterruptsProc) (
  1718.     FWIMPollInterruptsParamsPtr    pFWIMPollInterruptsParams);
  1719. typedef FWIMPollInterruptsProc    *FWIMPollInterruptsProcPtr;
  1720.  
  1721. typedef OSStatus (FWIMCommandProc) (
  1722.     FWIMCommandParamsPtr        pFWIMCommandParams,
  1723.     UInt32                        *pCommandAcceptance);
  1724. typedef FWIMCommandProc            *FWIMCommandProcPtr;
  1725.  
  1726. typedef OSStatus (FWIMSendPhyPacketProc) (
  1727.     FWIMSendPhyPacketParamsPtr    pFWIMSendPhyPacketParams,
  1728.     UInt32                        *pCommandAcceptance);
  1729. typedef FWIMSendPhyPacketProc    *FWIMSendPhyPacketProcPtr;
  1730.  
  1731. typedef OSStatus (FWIMAsynchTransactionProc) (
  1732.     FWIMAsynchCommandParamsPtr    pFWIMAsynchCommandParams,
  1733.     UInt32                        *pCommandAcceptance);
  1734. typedef FWIMAsynchTransactionProc
  1735.                                 *FWIMAsynchTransactionProcPtr;
  1736.  
  1737. typedef OSStatus (FWIMSendAsynchResponsePacketProc) (
  1738.     FWIMAsynchResponseCommandParamsPtr
  1739.                                 pFWIMAsynchResponseCommandParams,
  1740.     UInt32                        *pCommandAcceptance);
  1741. typedef FWIMSendAsynchResponsePacketProc
  1742.                                 *FWIMSendAsynchResponsePacketProcPtr;
  1743.  
  1744. typedef OSStatus (FWIMAllocateIsochPortProc) (
  1745.     FWIMAllocateIsochPortParamsPtr
  1746.                                 pFWIMAllocateIsochPortParams,
  1747.     UInt32                        *pCommandAcceptance);
  1748. typedef FWIMAllocateIsochPortProc
  1749.                                 *FWIMAllocateIsochPortProcPtr;
  1750.  
  1751. typedef OSStatus (FWIMReleaseIsochPortProc) (
  1752.     FWIMReleaseIsochPortParamsPtr
  1753.                                 pFWIMReleaseIsochPortParams,
  1754.     UInt32                        *pCommandAcceptance);
  1755. typedef FWIMReleaseIsochPortProc
  1756.                                 *FWIMReleaseIsochPortProcPtr;
  1757.  
  1758. typedef OSStatus (FWIMControlIsochPortProc) (
  1759.     FWIMIsochPortControlParamsPtr
  1760.                                 pFWIMIsochPortControlParams,
  1761.     UInt32                        *pCommandAcceptance);
  1762. typedef FWIMControlIsochPortProc
  1763.                                 *FWIMControlIsochPortProcPtr;
  1764.  
  1765. typedef OSStatus (FWIMGetUniqueIDProc) (
  1766.     FWIMGetUniqueIDParamsPtr    pFWIMGetUniqueIDParams,
  1767.     UInt32                        *pCommandAcceptance);
  1768. typedef FWIMGetUniqueIDProc        *FWIMGetUniqueIDProcPtr;
  1769.  
  1770. enum
  1771. {
  1772.     kFWIMPluginVersion            = 0x00010000
  1773. };
  1774.  
  1775. struct FWIMPluginDispatchTableStruct
  1776. {
  1777.     UInt32                        pluginVersion;
  1778.     FWIMInitializeProcPtr        fwimInitializeProc;        // Proc that initializes the FWIM.
  1779.     FWIMFinalizeProcPtr            fwimFinalizeProc;        // Proc that finalizes the FWIM.
  1780.     FWIMPollInterruptsProcPtr    fwimPollInterruptsProcPtr;    // Proc that polls for interrupts.
  1781.     FWIMSendPhyPacketProcPtr    fwimSendLinkOnPacketProc;    // Proc that sends a link on packet.
  1782.     FWIMSendPhyPacketProcPtr    fwimSendPhyConfigurationPacketProc;    // Proc that sends a phy configuration packet.
  1783.     FWIMAsynchTransactionProcPtr
  1784.                                 fwimReadProc;            // Proc that performs an asynchronous read transaction.
  1785.     FWIMSendAsynchResponsePacketProcPtr
  1786.                                 fwimReadResponseProc;    // Proc that sends an asynchronous read response packet.
  1787.     FWIMAsynchTransactionProcPtr
  1788.                                 fwimWriteProc;            // Proc that performs an asynchronous write transaction.
  1789.     FWIMSendAsynchResponsePacketProcPtr
  1790.                                 fwimWriteResponseProc;    // Proc that sends an asynchronous write response packet.
  1791.     FWIMAsynchTransactionProcPtr
  1792.                                 fwimLockProc;            // Proc that performs an asynchronous lock transaction.
  1793.     FWIMSendAsynchResponsePacketProcPtr
  1794.                                 fwimLockResponseProc;    // Proc that sends an asynchronous lock response packet.
  1795.     FWIMAllocateIsochPortProcPtr
  1796.                                 fwimAllocateIsochPortProc;    // Proc that allocates an isochronous port.
  1797.     FWIMReleaseIsochPortProcPtr    fwimReleaseIsochPortProc;    // Proc that releases an isochronous port.
  1798.     FWIMControlIsochPortProcPtr    fwimStartIsochPortProc;    // Proc that starts an isochronous port.
  1799.     FWIMControlIsochPortProcPtr    fwimStopIsochPortProc;    // Proc that stops an isochronous port.
  1800.     FWIMCommandProcPtr            fwimResetBusProc;        // Proc that initiates a FireWire bus reset.
  1801.     FWIMCommandProcPtr            fwimSetContenderBitProc;    // Proc that sets the contender bit.
  1802.     FWIMCommandProcPtr            fwimClearContenderBitProc;    // Proc that clears the contender bit.
  1803.     FWIMCommandProcPtr            fwimEnableCycleMasterProc;    // Proc that enables cycle mastering.
  1804.     FWIMCommandProcPtr            fwimDisableCycleMasterProc;    // Proc that disables cycle mastering.
  1805.     FWIMCommandProcPtr            fwimSetRootHoldoffBitProc;    // Proc that sets the root holdoff bit.
  1806.     FWIMCommandProcPtr            fwimClearRootHoldoffBitProc;    // Proc that clears the root holdoff bit.
  1807.     FWIMGetUniqueIDProcPtr        fwimGetUniqueIDProc;    // Proc that returns local unique ID.
  1808. };
  1809. typedef struct FWIMPluginDispatchTableStruct
  1810.                                 FWIMPluginDispatchTable,
  1811.                                 *FWIMPluginDispatchTablePtr;
  1812.  
  1813. typedef struct FWIMProcessParamsStruct
  1814.                                 FWIMProcessParams,
  1815.                                 *FWIMProcessParamsPtr;
  1816.  
  1817. typedef void    (FWIMProcessCompletionProc) (
  1818.     FWIMProcessParamsPtr        pFWIMProcessParams);
  1819. typedef FWIMProcessCompletionProc
  1820.                                 *FWIMProcessCompletionProcPtr;
  1821.  
  1822. struct FWIMProcessParamsStruct
  1823. {
  1824.     FWIMProcessParamsPtr        pNextFWIMProcessParams;    // Link to next set of params.
  1825.     UInt32                        processType;            // Type of processing.
  1826.     FWIMID                        fwimID;                    // Reference to calling FWIM.
  1827.     UInt32                        processFlags;            // Flag bits to control processing.
  1828.     UInt32                        processState;            // State bits of processing.
  1829.     UInt32                        processStatus;            // Final status of processing.
  1830.     FWIMProcessID                fwimProcessID;            // ID for this process.
  1831.     FWIMProcessCompletionProcPtr
  1832.                                 completionProc;            // Proc to call upon completion of processing.
  1833.     UInt32                        completionProcData;        // Data provided and used by caller.
  1834. };
  1835.  
  1836. struct FWIMProcessSelfIDsParamsStruct
  1837. {
  1838.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  1839.     UInt32                        generation;                // Bus generation of these self IDs.
  1840.     Ptr                            pSelfIDList;            // List of self IDs.
  1841.     UInt32                        selfIDListSize;            // Size of above list in bytes.
  1842.     Ptr                            pLocalSelfID;            // Local self ID if not included in above list.
  1843.     UInt32                        localSelfIDSize;        // Size of local self ID.
  1844.     UInt32                        processSelfIDsFlags;    // Flags controlling self ID processing.
  1845. };
  1846. typedef struct FWIMProcessSelfIDsParamsStruct
  1847.                                 FWIMProcessSelfIDsParams,
  1848.                                 *FWIMProcessSelfIDsParamsPtr;
  1849.  
  1850. enum
  1851. {
  1852.     kFWTransactionStatusAckCode            = FWBitRange (28, 31),
  1853.     kFWTransactionStatusAckCodePhase    = FWBitRangePhase (28, 31),
  1854.     kFWTransactionStatusSpeed            = FWBitRange (26, 27),
  1855.     kFWTransactionStatusSpeedPhase        = FWBitRangePhase (26, 27)
  1856. };
  1857.  
  1858. struct FWIMProcessAsynchParamsStruct
  1859. {
  1860.     FWIMProcessParams            fwimProcessParams;        // Common processing params.
  1861.     AbsoluteTime                timeStamp;                // Time stamp marking arrival time of packet.
  1862.     UInt32                        generation;                // Topology map generation number when packet was received.
  1863.     Ptr                            receiveBuffer;            // Buffer for data that we receive.
  1864.     UInt16                        destinationID;            // ID of destination node.
  1865.     UInt16                        transactionDescriptor;    // Descriptor for transaction.
  1866.     UInt16                        sourceID;                // ID of source node.
  1867.     UInt16                        addressHi;                // Destination address.
  1868.     UInt32                        addressLo;
  1869.     UInt16                        length;                    // Length of transaction.
  1870.     UInt16                        extendedTCode;            // Extended transaction code.
  1871.     UInt32                        transactionStatus;        // Status of transaction.
  1872. };
  1873. typedef struct FWIMProcessAsynchParamsStruct
  1874.                                 FWIMProcessAsynchParams,
  1875.                                 *FWIMProcessAsynchParamsPtr;
  1876.  
  1877.  
  1878. ////////////////////////////////////////////////////////////////////////////////
  1879. //
  1880. // FireWire virtual device defs.
  1881. //
  1882.  
  1883. /*zzz should be in VirtualDevice.h */
  1884. //zzz support multiple bus vdev??? (FW and SCSI vdev?)
  1885. //
  1886.  
  1887. enum
  1888. {
  1889.     kVDeviceDescriptionSignature
  1890.                                 = 'vdei'                // Virtual Device Export Information
  1891. };
  1892.  
  1893. enum
  1894. {
  1895.     kVDeviceDescriptionVersion    = 0x00010000
  1896. };
  1897.  
  1898. struct VDeviceDescriptionStruct
  1899. {
  1900.     OSType                        vDeviceDescSignature;    // Virtual Device Description signature.
  1901.     UInt32                        vDeviceDescVersion;        // Virtual Device Description version.
  1902.     UInt32                        vDeviceDescSize;        // Total size of this description.
  1903.     OSType                        vDeviceServiceCategory;    // Service category of family providing interface to this
  1904.                                                         // virtual device.
  1905. };
  1906. typedef struct VDeviceDescriptionStruct
  1907.                                 VDeviceDescription,
  1908.                                 *VDeviceDescriptionPtr;
  1909.  
  1910. struct FWVDeviceDescriptionStruct
  1911. {
  1912.     VDeviceDescription            vDeviceDescription;        // Universal Virtual Device description.
  1913.     UInt32                        unitSpecID;                // Unit Spec ID to present in unit directory (24-bit).
  1914.     UInt32                        unitSWVersion;            // Unit SW version to present in unit directory (24-bit).
  1915. };
  1916. typedef struct FWVDeviceDescriptionStruct
  1917.                                 FWVDeviceDescription,
  1918.                                 *FWVDeviceDescriptionPtr;
  1919.  
  1920. /*zzz*/
  1921.  
  1922. // Define FW virtual device proc names.
  1923. #define FWVDeviceInstallProcPascalName "\pFWVDeviceInstall"
  1924. #define FWVDeviceInterfaceProcPascalName "\pFWVDeviceInterface"
  1925.  
  1926. struct FWVDeviceInstallParamsStruct
  1927. {
  1928.     Ptr                            fwVDeviceSpecificData;    // Data specific to virtual device.
  1929.     FWVDeviceID                    fwVDeviceID;            // ID for this virtual device.
  1930.     CSRROMEntryID                fwVDeviceCSRROMUnitDirID;    // ID of the virtual device's CSR ROM unit directory.
  1931. };
  1932. typedef struct FWVDeviceInstallParamsStruct
  1933.                                 FWVDeviceInstallParams,
  1934.                                 *FWVDeviceInstallParamsPtr;
  1935.  
  1936. typedef OSStatus
  1937.     (FWVDeviceInstallProc) (
  1938.         FWVDeviceInstallParamsPtr    pFWVDeviceInstallParams);
  1939. typedef FWVDeviceInstallProc    *FWVDeviceInstallProcPtr;
  1940.  
  1941.  
  1942. ////////////////////////////////////////////////////////////////////////////////
  1943. //
  1944. // FireWire protocol driver defs.
  1945. //
  1946.  
  1947. enum
  1948. {
  1949.     kFWPDriverFileType            = 'ndrv'
  1950. };
  1951.  
  1952. enum
  1953. {
  1954.     kTheFWPDriverDescriptionSignature
  1955.                                 = 'pdei'
  1956. };
  1957.  
  1958. enum
  1959. {
  1960.     kInitialFWPDriverDescriptor    = 0
  1961. };
  1962.  
  1963. typedef UInt32    FWPDriverDescVersion;
  1964. typedef OptionBits    FWPDriverLoadingOptions;
  1965.  
  1966. typedef OSStatus    (FWPDriverUnitAddedProc) (
  1967.     FWPDriverID                    fwPDriverID,
  1968.     UInt32                        fwPDriverSpecificData,
  1969.     FWUnitID                    fwUnitID);
  1970. typedef FWPDriverUnitAddedProc
  1971.                                 *FWPDriverUnitAddedProcPtr;
  1972.  
  1973. typedef OSStatus    (FWPDriverUnitRemovedProc) (
  1974.     FWPDriverID                    fwPDriverID,
  1975.     UInt32                        fwPDriverSpecificData,
  1976.     FWUnitID                    fwUnitID);
  1977. typedef FWPDriverUnitRemovedProc
  1978.                                 *FWPDriverUnitRemovedProcPtr;
  1979.  
  1980. struct FWPDriverProtocolStruct
  1981. {
  1982.     UInt32                        specID;                    // IDs specifying protocol.
  1983.     UInt32                        swVersion;
  1984. };
  1985. typedef struct FWPDriverProtocolStruct
  1986.                                 FWPDriverProtocol,
  1987.                                 *FWPDriverProtocolPtr;
  1988.  
  1989. struct FWPDriverTypeStruct
  1990. {
  1991.     OSType                        fwPDriverServiceCategory;    // Service category that this protocol driver communicates over.
  1992.     NumVersion                    fwPDriverVersion;            // Protocol driver version number.
  1993. };
  1994. typedef struct FWPDriverTypeStruct
  1995.                                 FWPDriverType,
  1996.                                 *FWPDriverTypePtr;
  1997.  
  1998. struct FWPDriverLoadingInfoStruct
  1999. {
  2000.     FWPDriverLoadingOptions        fwPDriverLoadingOptions;    // Options for protocol driver loading.
  2001.     Str31                        fwPDriverName;            // Protocol driver's name when loading into the Name Registry.
  2002. };
  2003. typedef struct FWPDriverLoadingInfoStruct
  2004.                                 FWPDriverLoadingInfo,
  2005.                                 *FWPDriverLoadingInfoPtr;
  2006.  
  2007. struct FWPDriverDescriptionStruct
  2008. {
  2009.     OSType                        fwPDriverDescSignature;    // Signature field of this structure.
  2010.     FWPDriverDescVersion        fwPDriverDescVersion;    // Version of this data structure.
  2011.     FWPDriverType                fwPDriverType;            // Type of protocol driver.
  2012.     FWPDriverLoadingInfo        fwPDriverLoadingInfo;    // Loading information for protocol driver.
  2013. };
  2014. typedef struct FWPDriverDescriptionStruct
  2015.                                 FWPDriverDescription,
  2016.                                 *FWPDriverDescriptionPtr;
  2017.  
  2018.  
  2019. ////////////////////////////////////////////////////////////////////////////////
  2020. //
  2021. // FireWire Services defs.
  2022. //
  2023.  
  2024. // FireWire Services constants.
  2025.  
  2026. enum
  2027. {
  2028.     kFWCommandWaiting            = 1,
  2029.     kFWCommandBusy                = 2,
  2030.     kFWCommandComplete            = 3
  2031. };
  2032.  
  2033. enum
  2034. {
  2035.     kFWCommandSyncFlag            = (1 << 0),                // Perform command synchronously.
  2036.     kFWCommandPriorityFlag        = (1 << 1),                // This is a priority command.
  2037.     kFWCommandSynchronizeFlag    = (1 << 2),                // Wait for this command to complete before starting
  2038.                                                         // subsequent commands.
  2039.     kFWCommandImmediateFlag        = (1 << 3)                // Perform command immediately.
  2040. };
  2041.  
  2042. enum
  2043. {
  2044.     kInvalidFWNodeID            = 0x7FFFFFFF,
  2045.     kInvalidFWGenerationNumber    = 0x7FFFFFFF
  2046. };
  2047.  
  2048. enum
  2049. {
  2050.     kIsochChannelActiveBit        = (1 << 0),                // Isochronous channel is active.
  2051.     kIsochChannelInitializedBit    = (1 << 1),                // Isochronous channel has been initialized.
  2052.     kIsochChannelBandwidthAllocatedBit    = (1 << 2),        // Bandwidth has been allocated for isochronous channel.
  2053.     kIsochChannelChannelAllocatedBit    = (1 << 3),        // Channel number has been allocated for isochronous channel.
  2054.     kIsochChannelAllocateOnResetBit        = (1 << 4)        // Resources must be reallocated on bus reset.
  2055. };
  2056.  
  2057. enum
  2058. {
  2059.     kInvalidFWChannelNum        = 0x7FFFFFFF
  2060. };
  2061.  
  2062.  
  2063. // Define FireWire service interface selectors.
  2064.  
  2065. enum
  2066. {
  2067.     kFWRead                        = 1,                    // Perform a read across the bus.
  2068.     kFWWrite                    = 2,                    // Perform a write across the bus.
  2069.     kFWCompareAndSwap            = 3,                    // Perform a write across the bus.
  2070.     kFWSendFCPCommand            = 4,                    // Send an FCP command and wait for response.
  2071.     kFWResetBus                    = 5,                    // Reset the FireWire bus.
  2072.     kFWBitAnd                    = 6,                    // Perform an atomic bitwise and.
  2073.     kFWBitOr                    = 7,                    // Perform an atomic bitwise or.
  2074.     kFWBitXor                    = 8,                    // Perform an atomic bitwise xor.
  2075.     kFWIncrement                = 9,                    // Perform an atomic increment.
  2076.     kFWDecrement                = 10,                    // Perform an atomic decrement.
  2077.     kFWAdd                        = 11,                    // Perform an atomic add.
  2078.     kFWThresholdAdd                = 12,                    // Perform an atomic threshold add.
  2079.     kFWThresholdSubtract        = 13,                    // Perform an atomic threshold subtract.
  2080.     kFWClippedAdd                = 14,                    // Perform an atomic clipped add.
  2081.     kFWClippedSubtract            = 15,                    // Perform an atomic clipped subtract.
  2082.     kFWInitializeIsochronousChannel    = 16,                // Initialize an isochronous channel.
  2083.     kFWReleaseIsochronousChannel    = 17,                // Release an isochronous channel.
  2084.     kFWStartIsochronousChannel        = 18,                // Start an isochronous channel.
  2085.     kFWStopIsochronousChannel        = 19,                // Stop an isochronous channel.
  2086.     kFWAllocateLocalIsochronousPort    = 20,                // Allocate a local isochronous port.
  2087.     kFWReleaseLocalIsochronousPort    = 21,                // Release a local isochronous port.
  2088.     kFWStartLocalIsochronousPort    = 22,                // Start a local isochronous port.
  2089.     kFWStopLocalIsochronousPort        = 23                // Stop a local isochronous port.
  2090. };
  2091.  
  2092. enum
  2093. {
  2094.     kFWBasicCommandObjectType            = 1,            // Type of FireWire command object for basic commands.
  2095.     kFWAsynchCommandObjectType            = 2,            // Type of FireWire command object for asynchronous transaction commands.
  2096.     kFWIsochChannelCommandObjectType    = 3,            // Type of FireWire command object for isoch channel commands.
  2097.     kFWIsochPortCommandObjectType        = 4,            // Type of FireWire command object for isoch port commands.
  2098.     kFWFCPCommandObjectType                = 5                // Type of FireWire command object for FCP commands.
  2099. };
  2100.  
  2101. enum
  2102. {
  2103.     kFWAsynchOverrideMaxPayload    = (1 << 0),                // Override max payload transfer flag.
  2104.     kFWAsynchDisableAddressIncrement
  2105.                                 = (1 << 1),                // Disable auto incrementing of target addresses.
  2106.     kFWAsynchAbsoluteAddress    = (1 << 2),                // Use full 64-bit address.
  2107.     kFWAsynchFailOnBusReset        = (1 << 3)                // Fail asynchronous command if a bus reset occurs.
  2108. };
  2109.  
  2110. // FireWire service request type defs.
  2111.  
  2112. typedef void    (FWCommandCompletionProc) (
  2113.     FWCommandObjectID            fwCommandObjectID,
  2114.     OSStatus                    commandStatus,
  2115.     UInt32                        completionProcData);
  2116. typedef FWCommandCompletionProc    *FWCommandCompletionProcPtr;
  2117.  
  2118. enum
  2119. {
  2120.     kResponseDoneStatus            = 0,
  2121.     kResponseContinueStatus        = 1,
  2122.     kResponseUnrecognizedStatus    = 2
  2123. };
  2124.  
  2125. typedef UInt32    (FCPResponseHandler) (
  2126.     FWCommandObjectID            fwCommandObjectID,
  2127.     Ptr                            responseBuffer,
  2128.     UInt32                        responseLength);
  2129. typedef FCPResponseHandler        *FCPResponseHandlerPtr;
  2130.  
  2131. struct FWAddressStruct
  2132. {
  2133.     UInt32                        addressHi,
  2134.                                 addressLo;
  2135. };
  2136. typedef struct FWAddressStruct    FWAddress, *FWAddressPtr;
  2137.  
  2138.  
  2139. // FireWire Services procedure defs.
  2140.  
  2141. OSStatus    FWRegisterDriver (
  2142.     RegEntryIDPtr                pFWDriverRegEntry,
  2143.     FWDriverID                    *pFWDriverID,
  2144.     CSRROMEntryID                *pCSRUnitID,
  2145.     UInt32                        fwDriverSpecificData);
  2146.  
  2147. OSStatus    FWUnregisterDriver (
  2148.     FWDriverID                    fwDriverID);
  2149.  
  2150. OSStatus    FWRegisterProtocolDriver (
  2151.     RegEntryIDPtr                pFWPDriverRegEntry,
  2152.     FWPDriverID                    *pFWPDriverID,
  2153.     UInt32                        fwPDriverSpecificData);
  2154.  
  2155. OSStatus    FWUnregisterProtocolDriver (
  2156.     FWPDriverID                    fwPDriverID);
  2157.  
  2158. OSStatus    FWScanUnitsForFWPDriver (
  2159.     FWPDriverID                    fwPDriverID);
  2160.  
  2161. OSStatus    FWSetPDriverProtocolTable (
  2162.     FWPDriverID                    fwPDriverID,
  2163.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2164.     UInt32                        tableSize);
  2165.  
  2166. OSStatus    FWGetPDriverProtocolTable (
  2167.     FWPDriverID                    fwPDriverID,
  2168.     FWPDriverProtocolPtr        fwPDriverProtocolTable,
  2169.     UInt32                        *pTableSize,
  2170.     UInt32                        maxTableSize);
  2171.  
  2172. OSStatus    FWSetFWPDriverUnitAddedProc (
  2173.     FWPDriverID                    fwPDriverID,
  2174.     FWPDriverUnitAddedProcPtr    fwPDriverUnitAddedProc);
  2175.  
  2176. OSStatus    FWGetFWPDriverUnitAddedProc (
  2177.     FWPDriverID                    fwPDriverID,
  2178.     FWPDriverUnitAddedProcPtr    *pFWPDriverUnitAddedProc);
  2179.  
  2180. OSStatus    FWSetFWPDriverUnitRemovedProc (
  2181.     FWPDriverID                    fwPDriverID,
  2182.     FWPDriverUnitRemovedProcPtr    fwPDriverUnitRemovedProc);
  2183.  
  2184. OSStatus    FWGetFWPDriverUnitRemovedProc (
  2185.     FWPDriverID                    fwPDriverID,
  2186.     FWPDriverUnitRemovedProcPtr    *pFWPDriverUnitRemovedProc);
  2187.  
  2188. OSStatus    FWRegisterFSSpecPDriver (
  2189.     FSSpecPtr                    pFWPDriverFSSpec);
  2190.  
  2191. OSStatus    FWRegisterFSSpecResourcePDriver (
  2192.     FSSpecPtr                    pFWPDriverFSSpec,
  2193.     ResType                        fwPDriverResType,
  2194.     short                        fwPDriverResID);
  2195.  
  2196. OSStatus    FWAddUnitConnection (
  2197.     FWUnitID                    fwUnitID,
  2198.     FWReferenceID                fwReferenceID);
  2199.  
  2200. OSStatus    FWRemoveUnitConnection (
  2201.     FWUnitID                    fwUnitID,
  2202.     FWReferenceID                fwReferenceID);
  2203.  
  2204. OSStatus    FWSetFWClientResetNotifyProc (
  2205.     FWReferenceID                fwReferenceID,
  2206.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2207.  
  2208. OSStatus    FWGetFWClientResetNotifyProc (
  2209.     FWReferenceID                fwReferenceID,
  2210.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2211.  
  2212. OSStatus    FWSetFWClientBusManagementNotifyProc (
  2213.     FWReferenceID                fwReferenceID,
  2214.     FWClientResetNotifyProcPtr    fwClientResetNotifyProc);
  2215.  
  2216. OSStatus    FWGetFWClientBusManagementNotifyProc (
  2217.     FWReferenceID                fwReferenceID,
  2218.     FWClientResetNotifyProcPtr    *pFWClientResetNotifyProc);
  2219.  
  2220. OSStatus    FWSetFWClientReadRequestProc (
  2221.     FWReferenceID                fwReferenceID,
  2222.     FWClientReadProcPtr            fwClientReadRequestProc);
  2223.  
  2224. OSStatus    FWGetFWClientReadRequestProc (
  2225.     FWReferenceID                fwReferenceID,
  2226.     FWClientReadProcPtr            *pFWClientReadRequestProc);
  2227.  
  2228. OSStatus    FWSetFWClientReadCompleteProc (
  2229.     FWReferenceID                fwReferenceID,
  2230.     FWClientReadProcPtr            fwClientReadCompleteProc);
  2231.  
  2232. OSStatus    FWGetFWClientReadCompleteProc (
  2233.     FWReferenceID                fwReferenceID,
  2234.     FWClientReadProcPtr            *pFWClientReadCompleteProc);
  2235.  
  2236. OSStatus    FWSetFWClientWriteRequestProc (
  2237.     FWReferenceID                fwReferenceID,
  2238.     FWClientWriteProcPtr        fwClientWriteRequestProc);
  2239.  
  2240. OSStatus    FWGetFWClientWriteRequestProc (
  2241.     FWReferenceID                fwReferenceID,
  2242.     FWClientWriteProcPtr        *pFWClientWriteRequestProc);
  2243.  
  2244. OSStatus    FWSetFWClientWriteCompleteProc (
  2245.     FWReferenceID                fwReferenceID,
  2246.     FWClientWriteProcPtr        fwClientWriteCompleteProc);
  2247.  
  2248. OSStatus    FWGetFWClientWriteCompleteProc (
  2249.     FWReferenceID                fwReferenceID,
  2250.     FWClientWriteProcPtr        *pFWClientWriteCompleteProc);
  2251.  
  2252. OSStatus    FWSetFWClientLockRequestProc (
  2253.     FWReferenceID                fwReferenceID,
  2254.     FWClientLockProcPtr            fwClientLockRequestProc);
  2255.  
  2256. OSStatus    FWGetFWClientLockRequestProc (
  2257.     FWReferenceID                fwReferenceID,
  2258.     FWClientLockProcPtr            *pFWClientLockRequestProc);
  2259.  
  2260. OSStatus    FWSetFWClientLockCompleteProc (
  2261.     FWReferenceID                fwReferenceID,
  2262.     FWClientLockProcPtr            fwClientLockCompleteProc);
  2263.  
  2264. OSStatus    FWGetFWClientLockCompleteProc (
  2265.     FWReferenceID                fwReferenceID,
  2266.     FWClientLockProcPtr            *pFWClientLockCompleteProc);
  2267.  
  2268. OSStatus    FWSetFWClientInitIsochPortProc (
  2269.     FWReferenceID                fwReferenceID,
  2270.     FWClientInitIsochPortProcPtr
  2271.                                 fwClientInitIsochPortProc);
  2272.  
  2273. OSStatus    FWGetFWClientInitIsochPortProc (
  2274.     FWReferenceID                fwReferenceID,
  2275.     FWClientInitIsochPortProcPtr
  2276.                                 *pFWClientInitIsochPortProc);
  2277.  
  2278. OSStatus    FWSetFWClientReleaseIsochPortProc (
  2279.     FWReferenceID                fwReferenceID,
  2280.     FWClientReleaseIsochPortProcPtr
  2281.                                 fwClientReleaseIsochPortProc);
  2282.  
  2283. OSStatus    FWGetFWClientReleaseIsochPortProc (
  2284.     FWReferenceID                fwReferenceID,
  2285.     FWClientReleaseIsochPortProcPtr
  2286.                                 *pFWClientReleaseIsochPortProc);
  2287.  
  2288. OSStatus    FWSetFWClientStartIsochPortProc (
  2289.     FWReferenceID                fwReferenceID,
  2290.     FWClientStartIsochPortProcPtr
  2291.                                 fwClientStartIsochPortProc);
  2292.  
  2293. OSStatus    FWGetFWClientStartIsochPortProc (
  2294.     FWReferenceID                fwReferenceID,
  2295.     FWClientStartIsochPortProcPtr
  2296.                                 *pFWClientStartIsochPortProc);
  2297.  
  2298. OSStatus    FWSetFWClientStopIsochPortProc (
  2299.     FWReferenceID                fwReferenceID,
  2300.     FWClientStopIsochPortProcPtr
  2301.                                 fwClientStopIsochPortProc);
  2302.  
  2303. OSStatus    FWGetFWClientStopIsochPortProc (
  2304.     FWReferenceID                fwReferenceID,
  2305.     FWClientStopIsochPortProcPtr
  2306.                                 *pFWClientStopIsochPortProc);
  2307.  
  2308. TaskID    FWCurrentTaskID (void);
  2309.  
  2310. OSStatus    FWCreateSoftwareInterrupt (
  2311.     SoftwareInterruptHandler    theHandler,
  2312.     TaskID                        theTask,
  2313.     void                        *theParameter,
  2314.     Boolean                        persistent,
  2315.     SoftwareInterruptID            *theSoftwareInterrupt);
  2316.  
  2317. OSStatus    FWSendSoftwareInterrupt (
  2318.     SoftwareInterruptID            theSoftwareInterrupt,
  2319.     void                        *theParameter);
  2320.  
  2321. OSStatus    FWDeleteSoftwareInterrupt (
  2322.     SoftwareInterruptID            theSoftwareInterrupt);
  2323.  
  2324. OSStatus    FWAllocateFWCommandObject (
  2325.     FWCommandObjectID            *pFWCommandObjectID);
  2326.  
  2327. OSStatus    FWGetFWCommandObjectType (
  2328.     FWCommandObjectID            fwCommandObjectID,
  2329.     UInt32                        *pFWCommandObjectType);
  2330.  
  2331. OSStatus    FWGetFWCommandType (
  2332.     FWCommandObjectID            fwCommandObjectID,
  2333.     UInt32                        *pCommandType);
  2334.  
  2335. OSStatus    FWSetFWCommandFWReferenceID (
  2336.     FWCommandObjectID            fwCommandObjectID,
  2337.     FWReferenceID                fwReferenceID);
  2338.  
  2339. OSStatus    FWGetFWCommandFWReferenceID (
  2340.     FWCommandObjectID            fwCommandObjectID,
  2341.     FWReferenceID                *pFWReferenceID);
  2342.  
  2343. OSStatus    FWSetFWCommandFlags (
  2344.     FWCommandObjectID            fwCommandObjectID,
  2345.     UInt32                        commandFlags);
  2346.  
  2347. OSStatus    FWGetFWCommandFlags (
  2348.     FWCommandObjectID            fwCommandObjectID,
  2349.     UInt32                        *pCommandFlags);
  2350.  
  2351. OSStatus    FWGetFWCommandStatus (
  2352.     FWCommandObjectID            fwCommandObjectID,
  2353.     OSStatus                    *pCommandStatus);
  2354.  
  2355. OSStatus    FWSetFWCommandCompletionProc (
  2356.     FWCommandObjectID            fwCommandObjectID,
  2357.     FWCommandCompletionProcPtr    completionProc);
  2358.  
  2359. OSStatus    FWGetFWCommandCompletionProc (
  2360.     FWCommandObjectID            fwCommandObjectID,
  2361.     FWCommandCompletionProcPtr    *pCompletionProc);
  2362.  
  2363. OSStatus    FWSetFWCommandCompletionProcData (
  2364.     FWCommandObjectID            fwCommandObjectID,
  2365.     UInt32                        completionProcData);
  2366.  
  2367. OSStatus    FWGetFWCommandCompletionProcData (
  2368.     FWCommandObjectID            fwCommandObjectID,
  2369.     UInt32                        *pCompletionProcData);
  2370.  
  2371. OSStatus    FWSetFWCommandParams (
  2372.     FWCommandObjectID            fwCommandObjectID,
  2373.     FWReferenceID                fwReferenceID,
  2374.     UInt32                        commandFlags,
  2375.     FWCommandCompletionProcPtr    completionProc,
  2376.     UInt32                        completionProcData);
  2377.  
  2378. OSStatus    FWGetFWCommandParams (
  2379.     FWCommandObjectID            fwCommandObjectID,
  2380.     UInt32                        *pFWCommandObjectType,
  2381.     UInt32                        *pCommandType,
  2382.     FWReferenceID                *pFWReferenceID,
  2383.     UInt32                        *pCommandFlags,
  2384.     OSStatus                    *pCommandStatus,
  2385.     FWCommandCompletionProcPtr    *pCompletionProc,
  2386.     UInt32                        *pCompletionProcData);
  2387.  
  2388. OSStatus    FWDeallocateFWCommandObject (
  2389.     FWCommandObjectID            fwCommandObjectID);
  2390.  
  2391. OSStatus    FWGetTopologyMap (
  2392.     FWReferenceID                fwReferenceID,
  2393.     FWTopologyMapPtr            pFWTopologyMap);
  2394.  
  2395. OSStatus    FWAllocateAsynchCommandObject (
  2396.     FWCommandObjectID            *pFWCommandObjectID);
  2397.  
  2398. OSStatus    FWSetAsynchCommandGeneration (
  2399.     FWCommandObjectID            fwCommandObjectID,
  2400.     UInt32                        generation);
  2401.  
  2402. OSStatus    FWGetAsynchCommandGeneration (
  2403.     FWCommandObjectID            fwCommandObjectID,
  2404.     UInt32                        *pGeneration);
  2405.  
  2406. OSStatus    FWSetAsynchCommandAddress (
  2407.     FWCommandObjectID            fwCommandObjectID,
  2408.     UInt32                        addressHi,
  2409.     UInt32                        addressLo);
  2410.  
  2411. OSStatus    FWGetAsynchCommandAddress (
  2412.     FWCommandObjectID            fwCommandObjectID,
  2413.     UInt32                        *pAddressHi,
  2414.     UInt32                        *pAddressLo);
  2415.  
  2416. OSStatus    FWSetAsynchCommandBuffer (
  2417.     FWCommandObjectID            fwCommandObjectID,
  2418.     Ptr                            buffer);
  2419.  
  2420. OSStatus    FWGetAsynchCommandBuffer (
  2421.     FWCommandObjectID            fwCommandObjectID,
  2422.     Ptr                            *pBuffer);
  2423.  
  2424. OSStatus    FWSetAsynchCommandLength (
  2425.     FWCommandObjectID            fwCommandObjectID,
  2426.     UInt32                        length);
  2427.  
  2428. OSStatus    FWGetAsynchCommandLength (
  2429.     FWCommandObjectID            fwCommandObjectID,
  2430.     UInt32                        *pLength);
  2431.  
  2432. OSStatus    FWSetAsynchCommandBytesTransferred (
  2433.     FWCommandObjectID            fwCommandObjectID,
  2434.     UInt32                        bytesTransferred);
  2435.  
  2436. OSStatus    FWGetAsynchCommandBytesTransferred (
  2437.     FWCommandObjectID            fwCommandObjectID,
  2438.     UInt32                        *pBytesTransferred);
  2439.  
  2440. OSStatus    FWSetAsynchCommandMaxPayloadSize (
  2441.     FWCommandObjectID            fwCommandObjectID,
  2442.     UInt32                        maxPayloadSize);
  2443.  
  2444. OSStatus    FWGetAsynchCommandMaxPayloadSize (
  2445.     FWCommandObjectID            fwCommandObjectID,
  2446.     UInt32                        *pMaxPayloadSize);
  2447.  
  2448. OSStatus    FWSetAsynchCommandMaxRetries (
  2449.     FWCommandObjectID            fwCommandObjectID,
  2450.     UInt32                        maxRetries);
  2451.  
  2452. OSStatus    FWGetAsynchCommandMaxRetries (
  2453.     FWCommandObjectID            fwCommandObjectID,
  2454.     UInt32                        *pMaxRetries);
  2455.  
  2456. OSStatus    FWSetAsynchCommandTransferFlags (
  2457.     FWCommandObjectID            fwCommandObjectID,
  2458.     UInt32                        transferFlags);
  2459.  
  2460. OSStatus    FWGetAsynchCommandTransferFlags (
  2461.     FWCommandObjectID            fwCommandObjectID,
  2462.     UInt32                        *pTransferFlags);
  2463.  
  2464. OSStatus    FWSetAsynchCommandParams (
  2465.     FWCommandObjectID            fwCommandObjectID,
  2466.     UInt32                        generation,
  2467.     UInt32                        addressHi,
  2468.     UInt32                        addressLo,
  2469.     Ptr                            buffer,
  2470.     UInt32                        length,
  2471.     UInt32                        maxPayloadSize,
  2472.     UInt32                        maxRetries,
  2473.     UInt32                        transferFlags);
  2474.  
  2475. OSStatus    FWGetAsynchCommandParams (
  2476.     FWCommandObjectID            fwCommandObjectID,
  2477.     UInt32                        *pGeneration,
  2478.     UInt32                        *pAddressHi,
  2479.     UInt32                        *pAddressLo,
  2480.     Ptr                            *pBuffer,
  2481.     UInt32                        *pLength,
  2482.     UInt32                        *pBytesTransferred,
  2483.     UInt32                        *pMaxPayloadSize,
  2484.     UInt32                        *pMaxRetries,
  2485.     UInt32                        *pTransferFlags);
  2486.  
  2487. OSStatus    FWSetCommonAsynchCommandParams (
  2488.     FWCommandObjectID            fwCommandObjectID,
  2489.     UInt32                        addressHi,
  2490.     UInt32                        addressLo,
  2491.     Ptr                            buffer,
  2492.     UInt32                        length);
  2493.  
  2494. OSStatus    FWGetCommonAsynchCommandParams (
  2495.     FWCommandObjectID            fwCommandObjectID,
  2496.     Ptr                            *pBuffer,
  2497.     UInt32                        *pLength,
  2498.     UInt32                        *pBytesTransferred);
  2499.  
  2500. OSStatus    FWRead (
  2501.     FWCommandObjectID            fwCommandObjectID);
  2502.  
  2503. OSStatus    FWWrite (
  2504.     FWCommandObjectID            fwCommandObjectID);
  2505.  
  2506. OSStatus    FWCompareAndSwap (
  2507.     FWCommandObjectID            fwCommandObjectID);
  2508.  
  2509. OSStatus    FWBitAnd (
  2510.     FWCommandObjectID            fwCommandObjectID);
  2511.  
  2512. OSStatus    FWBitOr (
  2513.     FWCommandObjectID            fwCommandObjectID);
  2514.  
  2515. OSStatus    FWBitXor (
  2516.     FWCommandObjectID            fwCommandObjectID);
  2517.  
  2518. OSStatus    FWIncrement (
  2519.     FWCommandObjectID            fwCommandObjectID);
  2520.  
  2521. OSStatus    FWDecrement (
  2522.     FWCommandObjectID            fwCommandObjectID);
  2523.  
  2524. OSStatus    FWAdd (
  2525.     FWCommandObjectID            fwCommandObjectID);
  2526.  
  2527. OSStatus    FWThresholdAdd (
  2528.     FWCommandObjectID            fwCommandObjectID);
  2529.  
  2530. OSStatus    FWThresholdSubtract (
  2531.     FWCommandObjectID            fwCommandObjectID);
  2532.  
  2533. OSStatus    FWClippedAdd (
  2534.     FWCommandObjectID            fwCommandObjectID);
  2535.  
  2536. OSStatus    FWClippedSubtract (
  2537.     FWCommandObjectID            fwCommandObjectID);
  2538.  
  2539. OSStatus    FWSendFCPCommand (
  2540.     FWCommandObjectID            fwCommandObjectID);
  2541.  
  2542. OSStatus    FWAllocateFCPCommandObject (
  2543.     FWCommandObjectID            *pFWCommandObjectID);
  2544.  
  2545. OSStatus    FWSetFCPCommandCommandBuffer (
  2546.     FWCommandObjectID            fwCommandObjectID,
  2547.     Ptr                            commandBuffer);
  2548.  
  2549. OSStatus    FWGetFCPCommandCommandBuffer (
  2550.     FWCommandObjectID            fwCommandObjectID,
  2551.     Ptr                            *pCommandBuffer);
  2552.  
  2553. OSStatus    FWSetFCPCommandCommandLength (
  2554.     FWCommandObjectID            fwCommandObjectID,
  2555.     UInt32                        commandLength);
  2556.  
  2557. OSStatus    FWGetFCPCommandCommandLength (
  2558.     FWCommandObjectID            fwCommandObjectID,
  2559.     UInt32                        *pCommandLength);
  2560.  
  2561. OSStatus    FWSetFCPCommandResponseBuffer (
  2562.     FWCommandObjectID            fwCommandObjectID,
  2563.     Ptr                            responseBuffer);
  2564.  
  2565. OSStatus    FWGetFCPCommandResponseBuffer (
  2566.     FWCommandObjectID            fwCommandObjectID,
  2567.     Ptr                            *pResponseBuffer);
  2568.  
  2569. OSStatus    FWSetFCPCommandResponseBufferSize (
  2570.     FWCommandObjectID            fwCommandObjectID,
  2571.     UInt32                        responseBufferSize);
  2572.  
  2573. OSStatus    FWGetFCPCommandResponseBufferSize (
  2574.     FWCommandObjectID            fwCommandObjectID,
  2575.     UInt32                        *pResponseBufferSize);
  2576.  
  2577. OSStatus    FWSetFCPCommandResponseLength (
  2578.     FWCommandObjectID            fwCommandObjectID,
  2579.     UInt32                        responseLength);
  2580.  
  2581. OSStatus    FWGetFCPCommandResponseLength (
  2582.     FWCommandObjectID            fwCommandObjectID,
  2583.     UInt32                        *pResponseLength);
  2584.  
  2585. OSStatus    FWSetFCPCommandTimeout (
  2586.     FWCommandObjectID            fwCommandObjectID,
  2587.     Duration                    timeout);
  2588.  
  2589. OSStatus    FWGetFCPCommandTimeout (
  2590.     FWCommandObjectID            fwCommandObjectID,
  2591.     Duration                    *pTimeout);
  2592.  
  2593. OSStatus    FWSetFCPCommandMaxRetries (
  2594.     FWCommandObjectID            fwCommandObjectID,
  2595.     UInt32                        maxRetries);
  2596.  
  2597. OSStatus    FWGetFCPCommandMaxRetries (
  2598.     FWCommandObjectID            fwCommandObjectID,
  2599.     UInt32                        *pMaxRetries);
  2600.  
  2601. OSStatus    FWSetFCPCommandTransferFlags (
  2602.     FWCommandObjectID            fwCommandObjectID,
  2603.     UInt32                        transferFlags);
  2604.  
  2605. OSStatus    FWGetFCPCommandTransferFlags (
  2606.     FWCommandObjectID            fwCommandObjectID,
  2607.     UInt32                        *pTransferFlags);
  2608.  
  2609. OSStatus    FWSetFCPCommandResponseHandler (
  2610.     FWCommandObjectID            fwCommandObjectID,
  2611.     FCPResponseHandlerPtr        fcpResponseHandler);
  2612.  
  2613. OSStatus    FWGetFCPCommandResponseHandler (
  2614.     FWCommandObjectID            fwCommandObjectID,
  2615.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2616.  
  2617. OSStatus    FWSetFCPCommandParams (
  2618.     FWCommandObjectID            fwCommandObjectID,
  2619.     Ptr                            commandBuffer,
  2620.     UInt32                        commandLength,
  2621.     Ptr                            responseBuffer,
  2622.     UInt32                        responseBufferSize,
  2623.     Duration                    timeout,
  2624.     UInt32                        maxRetries,
  2625.     UInt32                        transferFlags,
  2626.     FCPResponseHandlerPtr        fcpResponseHandler);
  2627.  
  2628. OSStatus    FWGetFCPCommandParams (
  2629.     FWCommandObjectID            fwCommandObjectID,
  2630.     Ptr                            *pCommandBuffer,
  2631.     UInt32                        *pCommandLength,
  2632.     Ptr                            *pResponseBuffer,
  2633.     UInt32                        *pResponseBufferSize,
  2634.     UInt32                        *pResponseLength,
  2635.     Duration                    *pTimeout,
  2636.     UInt32                        *pMaxRetries,
  2637.     UInt32                        *pTransferFlags,
  2638.     FCPResponseHandlerPtr        *pFCPResponseHandler);
  2639.  
  2640. OSStatus    FWResetBus (
  2641.     FWCommandObjectID            fwCommandObjectID);
  2642.  
  2643. OSStatus    FWAllocateIsochronousChannelID (
  2644.     IsochChannelID                *pIsochChannelID,
  2645.     Boolean                        doIRMAllocation,
  2646.     UInt32                        bandwidth,
  2647.     UInt32                        preferredSpeed);
  2648.  
  2649. OSStatus    FWDeallocateIsochronousChannelID (
  2650.     IsochChannelID                isochChannelID);
  2651.  
  2652. OSStatus    FWAddIsochronousChannelClient (
  2653.     IsochChannelID                isochChannelID,
  2654.     FWReferenceID                fwReferenceID,
  2655.     UInt32                        refCon,
  2656.     Boolean                        clientIsTalker);
  2657.  
  2658. OSStatus    FWSetIsochChannelForceStopNotificationProc (
  2659.     IsochChannelID                isochChannelID,
  2660.     FWIsochChannelForceStopNotificationProcPtr
  2661.                                 fwIsochChannelForceStopNotificationProc);
  2662.  
  2663. OSStatus    FWInitializeIsochronousChannel (
  2664.     FWCommandObjectID            fwCommandObjectID);
  2665.  
  2666. OSStatus    FWReleaseIsochronousChannel (
  2667.     FWCommandObjectID            fwCommandObjectID);
  2668.  
  2669. OSStatus    FWStartIsochronousChannel (
  2670.     FWCommandObjectID            fwCommandObjectID);
  2671.  
  2672. OSStatus    FWStopIsochronousChannel (
  2673.     FWCommandObjectID            fwCommandObjectID);
  2674.  
  2675. OSStatus    FWAllocateIsochChannelCommandObject (
  2676.     FWCommandObjectID            *pFWCommandObjectID);
  2677.  
  2678. OSStatus    FWSetIsochChannelCommandIsochChannelID (
  2679.     FWCommandObjectID            fwCommandObjectID,
  2680.     IsochChannelID                isochChannelID);
  2681.  
  2682. OSStatus    FWGetIsochChannelCommandIsochChannelID (
  2683.     FWCommandObjectID            fwCommandObjectID,
  2684.     IsochChannelID                *pIsochChannelID);
  2685.  
  2686. OSStatus    FWCreateDCLProgram (
  2687.     DCLProgramID                *pDCLProgramID);
  2688.  
  2689. OSStatus    FWDisposeDCLProgram (
  2690.     DCLProgramID                dclProgramID);
  2691.  
  2692. OSStatus    FWSetDCLProgramStart (
  2693.     DCLProgramID                dclProgramID,
  2694.     DCLCommandPtr                pDCLStart);
  2695.  
  2696. OSStatus    FWGetDCLProgramStart (
  2697.     DCLProgramID                dclProgramID,
  2698.     DCLCommandPtr                *ppDCLStart);
  2699.  
  2700. OSStatus    FWSetDCLProgramEngineData (
  2701.     DCLProgramID                dclProgramID,
  2702.     UInt32                        dclEngineData);
  2703.  
  2704. OSStatus    FWGetDCLProgramEngineData (
  2705.     DCLProgramID                dclProgramID,
  2706.     UInt32                        *pDCLEngineData);
  2707.  
  2708. OSStatus    FWSetDCLProgramStartProc (
  2709.     DCLProgramID                dclProgramID,
  2710.     DCLProgramStartProcPtr        dclProgramStartProc);
  2711.  
  2712. OSStatus    FWGetDCLProgramStartProc (
  2713.     DCLProgramID                dclProgramID,
  2714.     DCLProgramStartProcPtr        *pDCLProgramStartProc);
  2715.  
  2716. OSStatus    FWSetDCLProgramStopProc (
  2717.     DCLProgramID                dclProgramID,
  2718.     DCLProgramStopProcPtr        dclProgramStopProc);
  2719.  
  2720. OSStatus    FWGetDCLProgramStopProc (
  2721.     DCLProgramID                dclProgramID,
  2722.     DCLProgramStopProcPtr        *pDCLProgramStopProc);
  2723.  
  2724. OSStatus    FWSetDCLProgramReleaseProc (
  2725.     DCLProgramID                dclProgramID,
  2726.     DCLProgramReleaseProcPtr    dclProgramReleaseProc);
  2727.  
  2728. OSStatus    FWGetDCLProgramReleaseProc (
  2729.     DCLProgramID                dclProgramID,
  2730.     DCLProgramReleaseProcPtr    *pDCLProgramReleaseProc);
  2731.  
  2732. OSStatus    FWSetDCLProgramCompilerNotificationProc (
  2733.     DCLProgramID                dclProgramID,
  2734.     DCLCompilerNotificationProcPtr
  2735.                                 dclCompilerNotificationProc);
  2736.  
  2737. OSStatus    FWGetDCLProgramCompilerNotificationProc (
  2738.     DCLProgramID                dclProgramID,
  2739.     DCLCompilerNotificationProcPtr
  2740.                                 *pDCLCompilerNotificationProc);
  2741.  
  2742. OSStatus    FWSetDCLProgramChannelNum (
  2743.     DCLProgramID                dclProgramID,
  2744.     UInt32                        channelNum);
  2745.  
  2746. OSStatus    FWGetDCLProgramChannelNum (
  2747.     DCLProgramID                dclProgramID,
  2748.     UInt32                        *pChannelNum);
  2749.  
  2750. OSStatus    FWSetDCLProgramTalking (
  2751.     DCLProgramID                dclProgramID,
  2752.     Boolean                        talking);
  2753.  
  2754. OSStatus    FWGetDCLProgramTalking (
  2755.     DCLProgramID                dclProgramID,
  2756.     Boolean                        *pTalking);
  2757.  
  2758. OSStatus    FWSetDCLProgramStartEvent (
  2759.     DCLProgramID                dclProgramID,
  2760.     UInt32                        startEvent,
  2761.     UInt32                        startEventState,
  2762.     UInt32                        startEventStateMask);
  2763.  
  2764. OSStatus    FWGetDCLProgramStartEvent (
  2765.     DCLProgramID                dclProgramID,
  2766.     UInt32                        *pStartEvent,
  2767.     UInt32                        *pStartEventState,
  2768.     UInt32                        *pStartEventStateMask);
  2769.  
  2770. OSStatus    FWTranslateDCLProgram (
  2771.     DCLProgramID                dclProgramID,
  2772.     DCLProgramID                *pTranslatedDCLProgramID);
  2773.  
  2774. OSStatus    FWStartDCLProgram (
  2775.     DCLProgramID                dclProgramID);
  2776.  
  2777. OSStatus    FWStopDCLProgram (
  2778.     DCLProgramID                dclProgramID);
  2779.  
  2780. OSStatus    FWReleaseDCLProgram (
  2781.     DCLProgramID                dclProgramID);
  2782.  
  2783. OSStatus    FWUpdateDCLList (
  2784.     DCLProgramID                dclProgramID,
  2785.     DCLCommandPtr                *dclCommandList,
  2786.     UInt32                        numDCLCommands);
  2787.  
  2788. OSStatus    FWModifyDCLList (
  2789.     DCLProgramID                dclProgramID,
  2790.     DCLCommandPtr                *dclCommandList,
  2791.     UInt32                        numDCLCommands);
  2792.  
  2793. OSStatus    FWModifyDCLJump (
  2794.     DCLProgramID                dclProgramID,
  2795.     DCLJumpPtr                    pDCLJump,
  2796.     DCLLabelPtr                    pDCLLabel);
  2797.  
  2798. OSStatus    FWCallDCLCallProc (
  2799.     DCLProgramID                dclProgramID,
  2800.     DCLCallProcPtr                pDCLCallProc);
  2801.  
  2802. OSStatus    FWAllocateIsochPortID (
  2803.     IsochPortID                    *pIsochPortID,
  2804.     DCLProgramID                dclProgramID,
  2805.     UInt32                        channelNum,
  2806.     UInt32                        speed,
  2807.     Boolean                        talking);
  2808.  
  2809. OSStatus    FWDeallocateIsochPortID (
  2810.     IsochPortID                    isochPortID);
  2811.  
  2812. OSStatus    FWAllocateLocalIsochronousPort (
  2813.     FWCommandObjectID            fwCommandObjectID);
  2814.  
  2815. OSStatus    FWReleaseLocalIsochronousPort (
  2816.     FWCommandObjectID            fwCommandObjectID);
  2817.  
  2818. OSStatus    FWStartLocalIsochronousPort (
  2819.     FWCommandObjectID            fwCommandObjectID);
  2820.  
  2821. OSStatus    FWStopLocalIsochronousPort (
  2822.     FWCommandObjectID            fwCommandObjectID);
  2823.  
  2824. OSStatus    FWContinueLocalIsochronousPort (
  2825.     FWCommandObjectID            fwCommandObjectID);
  2826.  
  2827. OSStatus    FWAllocateIsochPortCommandObject (
  2828.     FWCommandObjectID            *pFWCommandObjectID);
  2829.  
  2830. OSStatus    FWSetIsochPortCommandIsochPortID (
  2831.     FWCommandObjectID            fwCommandObjectID,
  2832.     IsochPortID                    isochPortID);
  2833.  
  2834. OSStatus    FWGetIsochPortCommandIsochPortID (
  2835.     FWCommandObjectID            fwCommandObjectID,
  2836.     IsochPortID                    *pIsochPortID);
  2837.  
  2838. OSStatus    FWCSRROMGetRootDirectory (
  2839.     FWReferenceID                fwReferenceID,
  2840.     CSRROMEntryID                *pCSRROMEntryID);
  2841.  
  2842. OSStatus    FWCSRROMGetEntryAddress (
  2843.     CSRROMEntryID                csrROMEntryID,
  2844.     UInt32                        *pAddress);
  2845.  
  2846. OSStatus    FWCSRROMGetEntryDataAddress (
  2847.     CSRROMEntryID                csrROMEntryID,
  2848.     UInt32                        *pAddress);
  2849.  
  2850. OSStatus    FWCSRROMCreateEntry (
  2851.     CSRROMEntryID                parentCSRROMEntryID,
  2852.     CSRROMEntryID                *pCSRROMEntryID,
  2853.     UInt32                        entryType,
  2854.     UInt32                        entryKeyValue,
  2855.     void                        *entryData,
  2856.     UInt32                        entrySize);
  2857.  
  2858. OSStatus    FWCSRROMDisposeEntry (
  2859.     CSRROMEntryID                csrROMEntryID);
  2860.  
  2861. OSStatus    FWCSRROMInstantiate (
  2862.     FWReferenceID                fwReferenceID);
  2863.  
  2864. OSStatus FWCSRROMCreateIterator (
  2865.     CSRROMEntryIterator            *pCSRROMIterator,
  2866.     FWReferenceID                fwReferenceID);
  2867.  
  2868. void FWCSRROMDisposeIterator (
  2869.     CSRROMEntryIterator            csrROMIterator);
  2870.  
  2871. OSStatus    FWCSRROMSetIterator (
  2872.     CSRROMEntryIterator            csrROMIterator,
  2873.     CSRROMEntryID                csrROMEntryID,
  2874.     CSRROMIterationOp            relationship);
  2875.  
  2876. OSStatus    FWCSRROMEntrySearch (
  2877.     CSRROMEntryIterator            csrROMIterator,
  2878.     CSRROMIterationOp            relationship,
  2879.     CSRROMEntryID                *pEntryID,
  2880.     Boolean                        *pDone,
  2881.     CSRROMSearchCriteriaPtr        pSearchCriteria,
  2882.     Ptr                            pEntryValue,
  2883.     UInt32                        *pEntrySize);
  2884.  
  2885. CSRROMEntryID    FWCSRROMCreateEntryID (void);
  2886.  
  2887. void  FWCSRROMDisposeEntryID (
  2888.     CSRROMEntryID                csrROMEntryID);
  2889.  
  2890. OSStatus    FWCSRROMCopyEntryID (
  2891.     CSRROMEntryID                srcCSRROMEntryID,
  2892.     CSRROMEntryID                *pDstCSRROMEntryID);
  2893.  
  2894. OSStatus    FWCSRROMCompareEntryIDs (
  2895.     CSRROMEntryID                csrROMEntryID1,
  2896.     CSRROMEntryID                csrROMEntryID2,
  2897.     Boolean                        *pCSRROMEntryIDsEqual);
  2898.  
  2899. void  FWCSRROMInvalidateEntryIDType (
  2900.     CSRROMEntryID                csrROMEntryID);
  2901.  
  2902. OSStatus    FWAllocateAddressSpace (
  2903.     FWAddressSpaceID            *pFWAddressSpaceID,
  2904.     FWReferenceID                fwReferenceID,
  2905.     FWAddressPtr                pFWAddress,
  2906.     UInt32                        size,
  2907.     Ptr                            addressBuffer,
  2908.     UInt32                        addressFlags,
  2909.     Ptr                            pAddressSpecificData);
  2910.  
  2911. OSStatus    FWDeallocateAddressSpace (
  2912.     FWAddressSpaceID            fwAddressSpaceID);
  2913.  
  2914. OSStatus    FWProcessReadRequest (
  2915.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  2916.  
  2917. OSStatus    FWProcessWriteRequest (
  2918.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  2919.  
  2920. OSStatus    FWProcessLockRequest (
  2921.     FWIMProcessAsynchParamsPtr    pFWIMProcessAsynchParams);
  2922.  
  2923. OSStatus    FWGetLocalFWReferenceIDFromFWReferenceID (
  2924.     FWReferenceID                fwReferenceID,
  2925.     FWReferenceID                *pLocalFWReferenceID);
  2926.  
  2927. OSStatus    FWGetFWDeviceIDFromFWReferenceID (
  2928.     FWReferenceID                fwReferenceID,
  2929.     FWDeviceID                    *pFWDeviceID);
  2930.  
  2931. OSStatus    FWFindFWDeviceFromNodeID (
  2932.     FWReferenceID                fwReferenceID,
  2933.     UInt32                        generation,
  2934.     UInt32                        nodeID,
  2935.     FWDeviceID                    *pFWDeviceID);
  2936.  
  2937. OSStatus    FWGetNodeID (
  2938.     FWReferenceID                fwReferenceID,
  2939.     UInt32                        *pNodeID,
  2940.     UInt32                        *pGenerationNumber);
  2941.  
  2942. OSStatus    FWGetUniqueID (
  2943.     FWReferenceID                fwReferenceID,
  2944.     CSRNodeUniqueIDPtr            pUniqueID);
  2945.  
  2946. OSStatus    FWGetUnitCSRROMEntryID (
  2947.     FWReferenceID                fwReferenceID,
  2948.     CSRROMEntryID                *pUnitCSRROMEntryID);
  2949.  
  2950. OSStatus    FWGetFWIsochResourceManagerID (
  2951.     FWReferenceID                fwReferenceID,
  2952.     FWIsochResourceManagerID    *pFWIsochResourceManagerID);
  2953.  
  2954. OSStatus    FWSetMaxPayloadSize (
  2955.     FWReferenceID                fwReferenceID,
  2956.     UInt32                        maxPayloadSize);
  2957.  
  2958. OSStatus    FWClientCommandIsComplete (
  2959.     FWClientCommandID            fwClientCommandID,
  2960.     OSStatus                    commandStatus);
  2961.  
  2962. OSStatus    FWIMCommandIsComplete (
  2963.     FWIMCommandID                fwimCommandID,
  2964.     OSStatus                    commandStatus);
  2965.  
  2966. OSStatus    FWProcessBusReset (
  2967.     FWIMID                        fwimID);
  2968.  
  2969. void    FWProcessSelfIDs (
  2970.     FWIMProcessSelfIDsParamsPtr    pFWIMProcessSelfIDsParams);
  2971.  
  2972. OSStatus    FWCreateDeferredTask (
  2973.     FWDeferredTaskID            *pFWDeferredTaskID,
  2974.     FWDeferredTaskProcPtr        fwDeferredTaskProc,
  2975.     void                        *param1);
  2976.  
  2977. OSStatus    FWDisposeDeferredTask (
  2978.     FWDeferredTaskID            fwDeferredTaskID);
  2979.  
  2980. OSStatus    FWScheduleDeferredTask (
  2981.     FWDeferredTaskID            fwDeferredTaskID,
  2982.     void                        *param2);
  2983.  
  2984.  
  2985. //zzz Put in Devices.h
  2986.  
  2987. /* Categories */
  2988.  
  2989. enum {
  2990.     kServiceCategoryFWIM        = 'fwim',                        /* FireWire interface module */
  2991.     kServiceCategoryFWDriver    = 'fwdv'                        /* FireWire device driver */
  2992. };
  2993.  
  2994. // End - Put in Devices.h
  2995.  
  2996. //zzz Put in Errors.h
  2997.  
  2998. enum {
  2999.     inUseErr                    = -4160,                // Item already in use
  3000.     notFoundErr                    = -4161,                // Item not found
  3001.     timeoutErr                    = -4162,                // Something timed out
  3002.     busReconfiguredErr            = -4163,                // Bus was reconfigured
  3003.     insufficientBandwidthErr    = -4164,                // Not enough bandwidth was available
  3004.     invalidIDErr                = -4165,                // Given ID is not valid.
  3005.     invalidIDTypeErr            = -4166,                // Given ID is of an invalid type for the requested operation.
  3006.     accessErr                    = -4167,                // Requested access not allowed.
  3007.     alreadyRegisteredErr        = -4168,                // Item has already been registered.
  3008.     disconnectedErr                = -4169,                // Target of request has been disconnected.
  3009.     retryExceededErr            = -4170,                // Retry limit was exceeded.
  3010.     addressRangeErr                = -4171,                // Address is not in range.
  3011.     addressAlignmentErr            = -4172,                // Address is not of proper alignment.
  3012.  
  3013.     multipleTalkerErr            = -4180,                // Tried to install multiple talkers
  3014.     channelActiveErr            = -4181,                // Operation not permitted when channel is active
  3015.     noListenerOrTalkerErr        = -4182,                // Every isochronous channel must have one talker and at least
  3016.                                                         // one listener
  3017.     noChannelsAvailableErr        = -4183,                // No supported isochronous channels are available
  3018.     channelNotAvailableErr        = -4184,                // Required channel was not available.
  3019.     invalidIsochPortIDErr        = -4185,                // An isochronous port ID is invalid.
  3020.     invalidFWReferenceTypeErr    = -4186,                // Operation does not support type of given reference ID
  3021.     separateBusErr                = -4187,                // Two or more entities are on two or more busses and cannot be associated with eachother.
  3022.     badSelfIDsErr                = -4188                    // Received self IDs are bad.
  3023. };
  3024.  
  3025. // end - Put in Errors.h
  3026.  
  3027. #if PRAGMA_ALIGN_SUPPORTED
  3028. #pragma options align=reset
  3029. #endif
  3030.  
  3031. #if PRAGMA_IMPORT_SUPPORTED
  3032. #pragma import off
  3033. #endif
  3034.  
  3035. #ifdef __cplusplus
  3036. }
  3037. #endif
  3038.  
  3039. #endif /* __FIREWIRE__ */
  3040.